[x264-devel] In Intra_4x4 mode, why h->predict_4x4 and x264_mb_encode_i4x4 twice

Erkang Chen bee33 at sjtu.edu.cn
Mon Apr 11 06:29:38 CEST 2005


Dear all:
I am just reading the Intra_4x4 mode coding part, and got a question.
Can anyone help me?

Q:
There are two steps done consecutively when encoding a frame, ie,
x264_macroblock_analyse( h );
x264_macroblock_encode( h );
Suppose a frame is encoded in Intra_4x4 mode.
In the former 'analyse' function, every 4x4 block is encoded with function 
x264_mb_encode_i4x4, and stored to h->fdec for further use by blocks after 
the current one.
    code:
            /* we need to encode this mb now (for next ones) */
            h->predict_4x4[res->i_predict4x4[x][y]]( p_dst_by, i_stride );
            x264_mb_encode_i4x4( h, idx, res->i_qp );

In the latter 'encode' function, every 4x4 block is again encoded with 
function x264_mb_encode_i4x4, and store to h->fdec.
    code:
            /* Do the right prediction */
            h->predict_4x4[i_mode]( p_dst, i_dst );

            /* encode one 4x4 block */
            x264_mb_encode_i4x4( h, i, i_qscale );
So why h->predict_4x4 and x264_mb_encode_i4x4 are executed twice.
I think after the 'analyse' function, the information stored in h->fdec is 
enough.

Thank you for patience!

Chen



-- 
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