ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / VLIB / Platform / arm9_P6 / UVLC / uvlc_mb_layer_p6.c
diff --git a/mardrone/ARDrone_SDK_Version_1_8_20110726/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c b/mardrone/ARDrone_SDK_Version_1_8_20110726/ARDroneLib/VLIB/Platform/arm9_P6/UVLC/uvlc_mb_layer_p6.c
new file mode 100644 (file)
index 0000000..34be901
--- /dev/null
@@ -0,0 +1,30 @@
+#include "../video_utils_p6.h"
+#include "uvlc_mb_layer_p6.h"
+
+#ifdef HAS_UVLC_WRITE_BLOCK
+void uvlc_write_block( video_stream_t* const stream, int16_t* data, int32_t num_coeff)
+{
+   int32_t code, run;
+
+  // DC coeff
+  code = *data++;
+  video_write_data( stream, code, 10 );
+  num_coeff--;
+  // AC coeff
+  run = 0;
+  while( num_coeff > 0 )
+    {
+      code = *data++;
+      if( code == 0 )
+      {
+        run ++;
+      }
+      else
+      {
+        num_coeff--;
+        uvlc_encode( stream, code, run, num_coeff );
+        run = 0;
+      }
+    }
+}
+#endif // HAS_UVLC_WRITE_BLOCK