[Ffmpeg-cvslog] r7284 - in trunk: libavcodec/jpeg_ls.c tests/ffmpeg.regression.ref tests/rotozoom.regression.ref

reimar subversion
Mon Dec 11 21:18:36 CET 2006


Author: reimar
Date: Mon Dec 11 21:18:36 2006
New Revision: 7284

Modified:
   trunk/libavcodec/jpeg_ls.c
   trunk/tests/ffmpeg.regression.ref
   trunk/tests/rotozoom.regression.ref

Log:
Fix JPEG-LS encoder 0xff-escaping writing too much or uninitialized data.


Modified: trunk/libavcodec/jpeg_ls.c
==============================================================================
--- trunk/libavcodec/jpeg_ls.c	(original)
+++ trunk/libavcodec/jpeg_ls.c	Mon Dec 11 21:18:36 2006
@@ -804,11 +804,16 @@
     av_free(zero);
     av_free(state);
 
+    // the specification says that after doing 0xff escaping unused bits in the
+    // last byte must be set to 0, so just append 7 "optional" zero-bits to
+    // avoid special-casing.
+    put_bits(&pb2, 7, 0);
+    size = put_bits_count(&pb2);
     flush_put_bits(&pb2);
     /* do escape coding */
-    size = put_bits_count(&pb2) >> 3;
     init_get_bits(&gb, buf2, size);
-    while(get_bits_count(&gb) < size * 8){
+    size -= 7;
+    while(get_bits_count(&gb) < size){
         int v;
         v = get_bits(&gb, 8);
         put_bits(&pb, 8, v);

Modified: trunk/tests/ffmpeg.regression.ref
==============================================================================
--- trunk/tests/ffmpeg.regression.ref	(original)
+++ trunk/tests/ffmpeg.regression.ref	Mon Dec 11 21:18:36 2006
@@ -105,8 +105,8 @@
 6264498 ./data/a-ljpeg.avi
 799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
 stddev:  0.00 PSNR:99.99 bytes:7602176
-8b9359781a7e87d09af1b1c9a536cb75 *./data/a-jpegls.avi
-9086694 ./data/a-jpegls.avi
+dca9d700da7857217408c310c501b9bc *./data/a-jpegls.avi
+9086676 ./data/a-jpegls.avi
 0f8637e9b861230aff9894825af83720 *./data/out.yuv
 stddev:  2.84 PSNR:39.04 bytes:7602176
 7eee6367442884321e27d15a26bc032a *./data/a-rv10.rm

Modified: trunk/tests/rotozoom.regression.ref
==============================================================================
--- trunk/tests/rotozoom.regression.ref	(original)
+++ trunk/tests/rotozoom.regression.ref	Mon Dec 11 21:18:36 2006
@@ -105,8 +105,8 @@
 4766558 ./data/a-ljpeg.avi
 dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
 stddev:  0.00 PSNR:99.99 bytes:7602176
-8a2f3984a27a7513545cf98bc05fd066 *./data/a-jpegls.avi
-8334508 ./data/a-jpegls.avi
+f67cd488dfd06c03ad1d6d94d81b80c8 *./data/a-jpegls.avi
+8334488 ./data/a-jpegls.avi
 a63d4e3ea1f0b0c0d44821da9e09b8f4 *./data/out.yuv
 stddev:  0.67 PSNR:51.57 bytes:7602176
 989a42671603dc1a7e6b156dccf0e820 *./data/a-rv10.rm




More information about the ffmpeg-cvslog mailing list