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.<br><br>
We discovered this by inserting an assertion in encoder/encoder.c at about line 1094:<br><br> return;<br> }<br> <br>+ assert(h->fenc->i_reference_count > 0);<br>+<br> /* move lowres copy of the image to the ref frame */<br>
for( i = 0; i < 4; i++)<br> {<br> XCHG( uint8_t*, h->fdec->lowres[i], h->fenc->lowres[i] );<br> XCHG( uint8_t*, h->fdec->buffer_lowres[i], h->fenc->buffer_lowres[i] );<br>
}<br><br>This assertion fails for some workloads, including simsmall from the parsec benchmarks.<br><br>We are using the following command line parameters to cause the assertion to fail:<br><br>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<br>
<br>Does this represent a bug?<br><br>