[x264-devel] Re: cost calculation of B frames
Loren Merritt
lorenm at u.washington.edu
Mon Apr 30 17:36:35 CEST 2007
On Mon, 30 Apr 2007, Lin Luo wrote:
> /* refine qpel */
> else if( i_partition == D_16x16 )
> {
> analysis.l0.me16x16.cost -= analysis.i_lambda *
> i_mb_b_cost_table[B_L0_L0];
> analysis.l1.me16x16.cost -= analysis.i_lambda *
> i_mb_b_cost_table[B_L1_L1];
> if( i_type == B_L0_L0 )
> {
> x264_me_refine_qpel( h, &analysis.l0.me16x16 );
> i_cost = analysis.l0.me16x16.cost
> + analysis.i_lambda * i_mb_b_cost_table[B_L0_L0];
> }
> else if( i_type == B_L1_L1 )
> {
> x264_me_refine_qpel( h, &analysis.l1.me16x16 );
> i_cost = analysis.l1.me16x16.cost
> + analysis.i_lambda * i_mb_b_cost_table[B_L1_L1];
> }
> else if( i_type == B_BI_BI )
> {
> x264_me_refine_qpel( h, &analysis.l0.me16x16 );
> x264_me_refine_qpel( h, &analysis.l1.me16x16 );
> }
> }
>
> Why if i_type is B_BI_BI, the variable i_cost does not update as the case
> i_type is B_L0_L0 and B_L1_L1?
> Is there any explanation?
Because updating the cost in L0 or L1 mode is free, it just takes the
cost from the last iteration of motion search. Bi mode would have to
compute an extra motion compensation + satd, which is not worthwhile just
for a slightly more precise Bi vs Intra comparison.
--Loren Merritt
--
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html
More information about the x264-devel
mailing list