[FFmpeg-cvslog] r25769 - trunk/libavcodec/adpcm.c

mstorsjo subversion
Fri Nov 19 18:36:29 CET 2010


Author: mstorsjo
Date: Fri Nov 19 18:36:29 2010
New Revision: 25769

Log:
adpcm: Only increment heap_pos after finding a good enough sample

This increases the PSNR slightly (about 0.1 dB) for trellis sizes
below 8, and gives equal PSNR for sizes above that.

Modified:
   trunk/libavcodec/adpcm.c

Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c	Fri Nov 19 18:35:52 2010	(r25768)
+++ trunk/libavcodec/adpcm.c	Fri Nov 19 18:36:29 2010	(r25769)
@@ -401,9 +401,10 @@ static void adpcm_compress_trellis(AVCod
                     } else {\
                         /* Try to replace one of the leaf nodes with the new \
                          * one, but try a different slot each time. */\
-                        pos = (frontier >> 1) + (heap_pos++ & ((frontier >> 1) - 1));\
+                        pos = (frontier >> 1) + (heap_pos & ((frontier >> 1) - 1));\
                         if (ssd > nodes_next[pos]->ssd)\
                             goto next_##NAME;\
+                        heap_pos++;\
                     }\
                     *h = generation;\
                     u = nodes_next[pos];\



More information about the ffmpeg-cvslog mailing list