<font size="4">Dear all:<br><br> I want to apply <u><span style="color: rgb(0, 0, 153);">transfrom_bypass</span> </u>mode to <span style="color: rgb(255, 0, 0);">a part of macroblocks</span> in a video(with several sequences concluded), but x264 only support compressing all the macroblocks of all frames in lossless mode. Therefore, I make some modification on x264. I try a few methods only to get a yuv output that is decoded incorrectly. I use JM17.2 and ffmpeg(the version supports high444) to test my encoded videos. Both of them cannot give the output expected.<br>
<br> The methods I tried are:<br> 1. set <u><i>h->sps->b_qpprime_y_zero_transform_bypass=1 </i></u>in <i><u>x264_sps_init</u></i>(set.c). <br> set set<i><u> h->mb.i_qp=0</u></i> at the end of <i><u>x264_macroblock_analyse</u></i>(analyse.c), if some conditions are meet.<br>
And according to the values of the variables metioned above( <u><i>if(h->sps->b_qpprime_y_zero_transform_bypass==1&&set h->mb.i_qp==0)</i></u>), it is judged that whether <i><u>h->mb.b_lossless=1</u></i> or not, just after the statement "</font><font size="4"><i><u>h->mb.i_qp=0</u></i></font><font size="4">"</font><font size="4">(analyse.c)</font><font size="4">.<br>
<br><br> 2. set <i><u>h->sps->b_qpprime_y_zero_transform_bypass=1</u></i> in <i><u>x264_sps_init</u></i>(set.c). <br>
set <i><u>h->mb.i_qp=0</u></i> in <u><i>x264_macroblock_analyse</i></u> before <i><u>x264_mb_analyse_init</u></i>(analyse.c), if some conditions are meet.<br> The x264 program contains serveral statements like <i><u> if(h->mb.b_lossless) </u><u>x264_predict_lossless_x*x()</u></i> or <i><u>if(h->mb.b_lossless)</u></i> then the operations of DCT and quantization are skipped(these results can be get by seaching reference in vs2005). I add the condition that "<u><i>||(h->mb.i_qp==0 && h->sps->b_qpprime_y_zero_transform_bypass==1</i></u>" into these IFs.<br>
<br> Both of the methods above cannot get the correct result.<br><br> Would you please give me some ideas of the right way of achieving the good results. <br> Thanks a lot!<br><br> your sincerely<br>
JinLei from China</font><br> <br>