[SCM] libdv/master: YUV_420_USE_YV12 option affects the wrong encoding.

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Thu Feb 9 01:04:30 UTC 2012


The following commit has been merged in the master branch:
commit 8489216d3f15e906844282e995a2d710de3bb059
Author: Alessio Treglia <alessio at debian.org>
Date:   Thu Feb 9 02:02:17 2012 +0100

    YUV_420_USE_YV12 option affects the wrong encoding.
    
    - The build configuration option --with-pal-yuv=YV12 actually affects
      encoding of "NTSC", inconsistent with decoding. This option is not
      currently used in Debian but could affect those who rebuild it.
    
    Closes: #466142
    Thanks: Ben Hutchings for report and patch.

diff --git a/debian/patches/1001-yuv_420_use_yv12_wrong_encoding.patch b/debian/patches/1001-yuv_420_use_yv12_wrong_encoding.patch
new file mode 100644
index 0000000..d76fa16
--- /dev/null
+++ b/debian/patches/1001-yuv_420_use_yv12_wrong_encoding.patch
@@ -0,0 +1,47 @@
+Subject: YUV_420_USE_YV12 build option affects encoding of NTSC frames
+From: Debian
+Author: Ben Hutchings <ben at decadent.org.uk>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466142
+Forwarded: no
+---
+ libdv/encode.c |   15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+--- libdv.orig/libdv/encode.c
++++ libdv/libdv/encode.c
+@@ -1712,15 +1712,15 @@ yuy2_to_ycb( uint8_t *data, int isPAL, s
+ /* ---------------------------------------------------------------------------
+  */
+ static void
+-yv12_to_ycb( uint8_t **in, int isPAL, short *img_y, short *img_cr, short *img_cb)
++yv12_to_ycb( uint8_t **in, short *img_y, short *img_cr, short *img_cb)
+ {
+-	register int total = DV_WIDTH * (isPAL ? DV_PAL_HEIGHT : DV_NTSC_HEIGHT);
++	register int total = DV_WIDTH * DV_PAL_HEIGHT;
+ 	register int i, j, k;
+ 	
+ 	
+ 	for (i = 0; i < total; i++) img_y[i]   = (((short) in[0][i]) - 128) << DCT_YUV_PRECISION;
+ 	
+-	for (i = 0; i < (isPAL ? DV_PAL_HEIGHT : DV_NTSC_HEIGHT)/2; ++i) {
++	for (i = 0; i < (DV_PAL_HEIGHT / 2); ++i) {
+ 	  for (j = 0; j < DV_WIDTH/2 ; j++) {
+ 	    
+ 	    k = i * DV_WIDTH/2 + j;
+@@ -1796,11 +1796,12 @@ int dv_encode_full_frame(dv_encoder_t *d
+ 			dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb);
+ 		break;
+ 	case e_dv_color_yuv:
+-#ifndef YUV_420_USE_YV12
+-		yuy2_to_ycb( in[0], dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb);
+-#else
+-		yv12_to_ycb( in, dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb);
++#ifdef YUV_420_USE_YV12
++		if (dv_enc->isPAL)
++			yv12_to_ycb( in, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb);
++		else
+ #endif
++			yuy2_to_ycb( in[0], dv_enc->isPAL, dv_enc->img_y, dv_enc->img_cr, dv_enc->img_cb);
+ 		break;
+ 	default:
+ 		fprintf(stderr, "Invalid value for color_space "
diff --git a/debian/patches/series b/debian/patches/series
index abb84ac..1db3947 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 0005-no_as_needed.patch
 0006-misspellings.patch
 0007-manpages.patch
+1001-yuv_420_use_yv12_wrong_encoding.patch

-- 
libdv packaging



More information about the pkg-multimedia-commits mailing list