From b0c101e2b41565947ced97b86f0965f19416e50f Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Wed, 15 May 2013 18:20:51 -0700 Subject: [PATCH] Removing lossless flag from the bitstream. Change-Id: If6aee510cbc4910f2f24fcd92dddc65fdf8edeea --- vp9/decoder/vp9_decodframe.c | 13 ++++++++----- vp9/encoder/vp9_bitstream.c | 3 --- vp9/encoder/vp9_encodeframe.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index 2e233c3..b200e6c 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -989,7 +989,14 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) { pc->clamp_type = (CLAMP_TYPE)vp9_read_bit(&header_bc); pc->error_resilient_mode = vp9_read_bit(&header_bc); - xd->lossless = vp9_read_bit(&header_bc); + setup_loopfilter(pc, xd, &header_bc); + + setup_quantization(pbi, &header_bc); + + xd->lossless = pc->base_qindex == 0 && + pc->y_dc_delta_q == 0 && + pc->uv_dc_delta_q == 0 && + pc->uv_ac_delta_q == 0; if (xd->lossless) { xd->inv_txm4x4_1 = vp9_short_iwalsh4x4_1; xd->inv_txm4x4 = vp9_short_iwalsh4x4; @@ -1004,10 +1011,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) { xd->itxm_add_uv_block = vp9_idct_add_uv_block; } - setup_loopfilter(pc, xd, &header_bc); - - setup_quantization(pbi, &header_bc); - // Determine if the golden frame or ARF buffer should be updated and how. // For all non key frames the GF and ARF refresh flags and sign bias // flags must be set explicitly. diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 3985451..3c234af 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -1566,9 +1566,6 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) { // error resilient mode vp9_write_bit(&header_bc, pc->error_resilient_mode); - // lossless mode: note this needs to be before loopfilter - vp9_write_bit(&header_bc, cpi->mb.e_mbd.lossless); - encode_loopfilter(pc, xd, &header_bc); encode_quantization(pc, &header_bc); diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 954eefa..69ab147 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1269,10 +1269,10 @@ static void encode_frame_internal(VP9_COMP *cpi) { vp9_zero(cpi->coef_counts_32x32); vp9_zero(cm->fc.eob_branch_counts); - cpi->mb.e_mbd.lossless = (cm->base_qindex == 0 && - cm->y_dc_delta_q == 0 && - cm->uv_dc_delta_q == 0 && - cm->uv_ac_delta_q == 0); + cpi->mb.e_mbd.lossless = cm->base_qindex == 0 && + cm->y_dc_delta_q == 0 && + cm->uv_dc_delta_q == 0 && + cm->uv_ac_delta_q == 0; switch_lossless_mode(cpi, cpi->mb.e_mbd.lossless); vp9_frame_init_quantizer(cpi); -- 2.7.4