[x264-devel] Should x264_reference_update be modifying unreferenced frames?

Gregory Hartman ghartman17022 at gmail.com
Thu Aug 6 06:11:27 CEST 2009


Andrew and I are examining the memory behavior of x264, and we've noticed
something that appears to be quite odd. It seems that x264_reference_update
occasionally writes to frames that have a reference count of 0.

We discovered this by inserting an assertion in encoder/encoder.c at about
line 1094:

         return;
     }

+    assert(h->fenc->i_reference_count > 0);
+
     /* move lowres copy of the image to the ref frame */
     for( i = 0; i < 4; i++)
     {
         XCHG( uint8_t*, h->fdec->lowres[i], h->fenc->lowres[i] );
         XCHG( uint8_t*, h->fdec->buffer_lowres[i],
h->fenc->buffer_lowres[i] );
     }

This assertion fails for some workloads, including simsmall from the parsec
benchmarks.

We are using the following command line parameters to cause the assertion to
fail:

x264 --quiet --qp 20 --partitions b8x8,i4x4 --ref 5 --direct auto
--b-pyramid --weightb --mixed-refs --no-fast-pskip --me umh --subme 7
--analyse b8x8,i4x4 --threads 2 -o eledream.264 eledream_640x360_8.y4m

Does this represent a bug?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20090806/cb9abe91/attachment.htm>


More information about the x264-devel mailing list