Bitstream for leaves can be computed in parallel

This commit is contained in:
Laurent Fasnacht 2014-05-08 08:45:48 +02:00
parent be9882f5b2
commit 163189c3c7

View file

@ -50,6 +50,8 @@ static void encode_sao(encoder_state *encoder,
unsigned x_lcu, uint16_t y_lcu, unsigned x_lcu, uint16_t y_lcu,
sao_info *sao_luma, sao_info *sao_chroma); sao_info *sao_luma, sao_info *sao_chroma);
static void encoder_state_write_bitstream_leaf(encoder_state * const encoder_state);
/*! /*!
\brief Initializes lambda-value for current QP \brief Initializes lambda-value for current QP
@ -1184,7 +1186,9 @@ static void encoder_state_encode(encoder_state * const main_state) {
encoder_state_blit_pixels(sub_state, sub_state->tile->cur_pic->v_data, main_state, main_state->tile->cur_pic->v_data, 0); encoder_state_blit_pixels(sub_state, sub_state->tile->cur_pic->v_data, main_state, main_state->tile->cur_pic->v_data, 0);
} }
encoder_state_encode(&main_state->children[i]); encoder_state_encode(&main_state->children[i]);
//FIXME: substream_write_bitstream(subencoder, (main_state->children[i+1].encoder_control) != NULL); if (main_state->children[i].is_leaf) {
encoder_state_write_bitstream_leaf(&main_state->children[i]);
}
if (sub_state->tile != main_state->tile) { if (sub_state->tile != main_state->tile) {
encoder_state_blit_pixels(main_state, main_state->tile->cur_pic->y_recdata, sub_state, sub_state->tile->cur_pic->y_recdata, 1); encoder_state_blit_pixels(main_state, main_state->tile->cur_pic->y_recdata, sub_state, sub_state->tile->cur_pic->y_recdata, 1);
@ -1203,7 +1207,9 @@ static void encoder_state_encode(encoder_state * const main_state) {
encoder_state_blit_pixels(sub_state, sub_state->tile->cur_pic->v_data, main_state, main_state->tile->cur_pic->v_data, 0); encoder_state_blit_pixels(sub_state, sub_state->tile->cur_pic->v_data, main_state, main_state->tile->cur_pic->v_data, 0);
} }
encoder_state_encode(&main_state->children[i]); encoder_state_encode(&main_state->children[i]);
//FIXME: substream_write_bitstream(subencoder, (main_state->children[i+1].encoder_control) != NULL); if (main_state->children[i].is_leaf) {
encoder_state_write_bitstream_leaf(&main_state->children[i]);
}
if (sub_state->tile != main_state->tile) { if (sub_state->tile != main_state->tile) {
encoder_state_blit_pixels(main_state, main_state->tile->cur_pic->y_recdata, sub_state, sub_state->tile->cur_pic->y_recdata, 1); encoder_state_blit_pixels(main_state, main_state->tile->cur_pic->y_recdata, sub_state, sub_state->tile->cur_pic->y_recdata, 1);
@ -1378,9 +1384,7 @@ static void encoder_state_write_bitstream_slice(encoder_state * const main_state
static void encoder_state_write_bitstream(encoder_state * const main_state) { static void encoder_state_write_bitstream(encoder_state * const main_state) {
int i; int i;
if (main_state->is_leaf) { if (!main_state->is_leaf) {
encoder_state_write_bitstream_leaf(main_state);
} else {
for (i=0; main_state->children[i].encoder_control; ++i) { for (i=0; main_state->children[i].encoder_control; ++i) {
encoder_state *sub_state = &(main_state->children[i]); encoder_state *sub_state = &(main_state->children[i]);
encoder_state_write_bitstream(sub_state); encoder_state_write_bitstream(sub_state);