| 1 |
Subject: YUV_420_USE_YV12 build option affects encoding of NTSC frames |
| 2 |
From: Debian |
| 3 |
Author: Ben Hutchings <[email protected]> |
| 4 |
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466142 |
| 5 |
Forwarded: no |
| 6 |
--- |
| 7 |
libdv/encode.c | 15 ++++++++------- |
| 8 |
1 file changed, 8 insertions(+), 7 deletions(-) |
| 9 |
|
| 10 |
--- libdv.orig/libdv/encode.c |
| 11 |
+++ libdv/libdv/encode.c |
| 12 |
@@ -1712,15 +1712,15 @@ yuy2_to_ycb( uint8_t *data, int isPAL, s |
| 13 |
/* --------------------------------------------------------------------------- |
| 14 |
*/ |
| 15 |
static void |
| 16 |
|
| 17 |
+yv12_to_ycb( uint8_t **in, short *img_y, short *img_cr, short *img_cb) |
| 18 |
{ |
| 19 |
|
| 20 |
+ register int total = DV_WIDTH * DV_PAL_HEIGHT; |
| 21 |
register int i, j, k; |
| 22 |
|
| 23 |
|
| 24 |
for (i = 0; i < total; i++) img_y[i] = (((short) in[0][i]) - 128) << DCT_YUV_PRECISION; |
| 25 |
|
| 26 |
|
| 27 |
+ for (i = 0; i < (DV_PAL_HEIGHT / 2); ++i) { |
| 28 |
for (j = 0; j < DV_WIDTH/2 ; j++) { |
| 29 |
|
| 30 |
k = i * DV_WIDTH/2 + j; |
| 31 |
@@ -1796,11 +1796,12 @@ int dv_encode_full_frame(dv_encoder_t *d |
| 32 |
dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); |
| 33 |
break; |
| 34 |
case e_dv_color_yuv: |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
+#ifdef YUV_420_USE_YV12 |
| 40 |
+ if (dv_enc->isPAL) |
| 41 |
+ yv12_to_ycb( in, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); |
| 42 |
+ else |
| 43 |
#endif |
| 44 |
+ yuy2_to_ycb( in[0], dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb); |
| 45 |
break; |
| 46 |
default: |
| 47 |
fprintf(stderr, "Invalid value for color_space " |