summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2005-05-09 15:42:59 +0000
committerdeva <deva>2005-05-09 15:42:59 +0000
commit9145542156e3f45330e831ebddbcf735018a1d7f (patch)
treeb8000da79d252d11e4f778d5eba8ff81d109386b
parentb40323cc5eda96237399181aa2b7251813d113f8 (diff)
*** empty log message ***
-rw-r--r--TODO44
1 files changed, 44 insertions, 0 deletions
diff --git a/TODO b/TODO
index a55bfab..c006ed2 100644
--- a/TODO
+++ b/TODO
@@ -159,3 +159,47 @@ email.
\ ,-----------.
->| Encoder |
`-----------'
+
+
+==========================================================================
+ This code should convert yuv to yuv422 planar
+==========================================================================
+int Frame::ExtractYUV420( uint8_t *yuv, uint8_t *output[ 3 ] )
+{
+ unsigned char *pixels[ 3 ];
+ int pitches[ 3 ];
+ int width = GetWidth(), height = GetHeight();
+
+ pixels[ 0 ] = ( unsigned char* ) yuv;
+ pitches[ 0 ] = decoder->width * 2;
+
+ dv_decode_full_frame( decoder, data, e_dv_color_yuv, pixels, pitches );
+
+ int w2 = width / 2;
+ uint8_t *y = output[ 0 ];
+ uint8_t *cb = output[ 1 ];
+ uint8_t *cr = output[ 2 ];
+ uint8_t *p = yuv;
+
+ for ( int i = 0; i < height; i += 2 )
+ {
+ /* process two scanlines (one from each field, interleaved) */
+ for ( int j = 0; j < w2; j++ )
+ {
+ /* packed YUV 422 is: Y[i] U[i] Y[i+1] V[i] */
+ *( y++ ) = *( p++ );
+ *( cb++ ) = *( p++ );
+ *( y++ ) = *( p++ );
+ *( cr++ ) = *( p++ );
+ }
+ /* process next two scanlines (one from each field, interleaved) */
+ for ( int j = 0; j < w2; j++ )
+ {
+ /* skip every second line for U and V */
+ *( y++ ) = *( p++ );
+ p++;
+ *( y++ ) = *( p++ );
+ p++;
+ }
+ }
+} \ No newline at end of file