[SCM] libav/experimental: try to select w/h from tables

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:41:24 UTC 2013


The following commit has been merged in the experimental branch:
commit b2a1c77162849e43a75910a535a2d2644de73057
Author: Alex Beregszaszi <alex at rtfs.hu>
Date:   Wed Sep 8 17:57:25 2004 +0000

    try to select w/h from tables
    
    Originally committed as revision 3443 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c
index ae79afe..448aa93 100644
--- a/libavcodec/svq1.c
+++ b/libavcodec/svq1.c
@@ -880,6 +880,8 @@ static int svq1_decode_end(AVCodecContext *avctx)
 
 static void svq1_write_header(SVQ1Context *s, int frame_type)
 {
+    int i;
+
     /* frame code */
     put_bits(&s->pb, 22, 0x20);
 
@@ -898,12 +900,22 @@ static void svq1_write_header(SVQ1Context *s, int frame_type)
         /* output 5 unknown bits (2 + 2 + 1) */
         put_bits(&s->pb, 5, 0);
 
-        /* forget about matching up resolutions, just use the free-form
-         * resolution code (7) for now */
-        put_bits(&s->pb, 3, 7);
-        put_bits(&s->pb, 12, s->frame_width);
-        put_bits(&s->pb, 12, s->frame_height);
-
+	for (i = 0; i < 7; i++)
+	{
+	    if ((svq1_frame_size_table[i].width == s->frame_width) &&
+		(svq1_frame_size_table[i].height == s->frame_height))
+	    {
+		put_bits(&s->pb, 3, i);
+		break;
+	    }
+	}
+	
+	if (i == 7)
+	{
+	    put_bits(&s->pb, 3, 7);
+    	    put_bits(&s->pb, 12, s->frame_width);
+    	    put_bits(&s->pb, 12, s->frame_height);
+	}
     }
 
     /* no checksum or extra data (next 2 bits get 0) */
diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref
index 5b2a90b..8c902c7 100644
--- a/tests/ffmpeg.regression.ref
+++ b/tests/ffmpeg.regression.ref
@@ -107,8 +107,8 @@ stddev:  8.08 PSNR:29.97 bytes:7602176
 2653690 ./data/a-ffv1.avi
 799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
 stddev:  0.00 PSNR:99.99 bytes:7602176
-c672f70e2176a897b1ba816749574751 *./data/a-svq1.mov
-1384019 ./data/a-svq1.mov
+b92d6d901574ea17e43e96ea97637078 *./data/a-svq1.mov
+1383999 ./data/a-svq1.mov
 ccc201054669e94717022bb4f2aea4ce *./data/out.yuv
 stddev: 10.99 PSNR:27.30 bytes:7602176
 21f8ff9f1daacd9133683bb4ea0f50a4 *./data/a-mp2.mp2

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list