diff options
author | Yaowu Xu <yaowu@google.com> | 2013-02-11 21:14:46 -0800 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2013-02-13 09:24:39 -0800 |
commit | 17db5d00be2f005f11428edf0fd23265d04d100f (patch) | |
tree | f6f0890b6c3351dcfcb030fdd86491dfc16a9489 /vp9/encoder/vp9_rdopt.c | |
parent | 16f25f9dc83a37f2a16c7652445b6a6ecf8034af (diff) | |
download | libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.tar libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.tar.gz libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.tar.bz2 libvpx-17db5d00be2f005f11428edf0fd23265d04d100f.zip |
enable bitstream lossless support
1. Added a bit in frame header to to indicate if a frame is encoded
in lossless mode, so decoder does not make the decision based on Q0
2. Minor changes to make sure that lossy coding works same as when
the lossless experiment is not enabled.
3. Renamed function pointers for transforms to be consistent, using
prefix fwd_txm and inv_txm for forward and inverse respectively
To encode in lossless mode, using "--lossless=1 --min-q=0 --max-q=0"
with vpxenc.
Change-Id: Ifae53b26d2ffbe378d707e29d96817b8a5e6c068
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 762a9294c..05277c599 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1140,7 +1140,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be, vp9_fht(be->src_diff, 32, be->coeff, tx_type, 4); vp9_ht_quantize_b_4x4(be, b, tx_type); } else { - x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32); + x->fwd_txm4x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4(be, b); } @@ -1172,7 +1172,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be, if (best_tx_type != DCT_DCT) vp9_ihtllm(best_dqcoeff, b->diff, 32, best_tx_type, 4, b->eob); else - xd->inv_xform4x4_x8(best_dqcoeff, b->diff, 32); + xd->inv_txm4x4(best_dqcoeff, b->diff, 32); vp9_recon_b(best_predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); @@ -1436,7 +1436,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib, if (tx_type != DCT_DCT) vp9_fht(be->src_diff, 32, (x->block + idx)->coeff, tx_type, 8); else - x->vp9_short_fdct8x8(be->src_diff, (x->block + idx)->coeff, 32); + x->fwd_txm8x8(be->src_diff, (x->block + idx)->coeff, 32); x->quantize_b_8x8(x->block + idx, xd->block + idx); // compute quantization mse of 8x8 block @@ -1470,11 +1470,11 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib, vp9_fht_c(be->src_diff, 32, be->coeff, tx_type, 4); vp9_ht_quantize_b_4x4(be, b, tx_type); } else if (!(i & 1) && get_tx_type_4x4(xd, b + 1) == DCT_DCT) { - x->vp9_short_fdct8x4(be->src_diff, be->coeff, 32); + x->fwd_txm8x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4_pair(be, be + 1, b, b + 1); do_two = 1; } else { - x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32); + x->fwd_txm4x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4(be, b); } distortion += vp9_block_error_c(be->coeff, b->dqcoeff, 16 << do_two); @@ -2244,7 +2244,7 @@ static int64_t encode_inter_mb_segment(MACROBLOCK *x, if (xd->mode_info_context->mbmi.second_ref_frame > 0) vp9_build_2nd_inter_predictors_b(bd, 16, &xd->subpix); vp9_subtract_b(be, bd, 16); - x->vp9_short_fdct4x4(be->src_diff, be->coeff, 32); + x->fwd_txm4x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4(be, bd); thisdistortion = vp9_block_error(be->coeff, bd->dqcoeff, 16); *distortion += thisdistortion; @@ -2296,7 +2296,7 @@ static int64_t encode_inter_mb_segment_8x8(MACROBLOCK *x, if (xd->mode_info_context->mbmi.txfm_size == TX_4X4) { if (otherrd) { - x->vp9_short_fdct8x8(be->src_diff, be2->coeff, 32); + x->fwd_txm8x8(be->src_diff, be2->coeff, 32); x->quantize_b_8x8(be2, bd2); thisdistortion = vp9_block_error_c(be2->coeff, bd2->dqcoeff, 64); otherdist += thisdistortion; @@ -2308,7 +2308,7 @@ static int64_t encode_inter_mb_segment_8x8(MACROBLOCK *x, for (j = 0; j < 4; j += 2) { bd = &xd->block[ib + iblock[j]]; be = &x->block[ib + iblock[j]]; - x->vp9_short_fdct8x4(be->src_diff, be->coeff, 32); + x->fwd_txm8x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4_pair(be, be + 1, bd, bd + 1); thisdistortion = vp9_block_error_c(be->coeff, bd->dqcoeff, 32); *distortion += thisdistortion; @@ -2326,7 +2326,7 @@ static int64_t encode_inter_mb_segment_8x8(MACROBLOCK *x, for (j = 0; j < 4; j += 2) { BLOCKD *bd = &xd->block[ib + iblock[j]]; BLOCK *be = &x->block[ib + iblock[j]]; - x->vp9_short_fdct8x4(be->src_diff, be->coeff, 32); + x->fwd_txm8x4(be->src_diff, be->coeff, 32); x->quantize_b_4x4_pair(be, be + 1, bd, bd + 1); thisdistortion = vp9_block_error_c(be->coeff, bd->dqcoeff, 32); otherdist += thisdistortion; @@ -2340,7 +2340,7 @@ static int64_t encode_inter_mb_segment_8x8(MACROBLOCK *x, TX_4X4); } } - x->vp9_short_fdct8x8(be->src_diff, be2->coeff, 32); + x->fwd_txm8x8(be->src_diff, be2->coeff, 32); x->quantize_b_8x8(be2, bd2); thisdistortion = vp9_block_error_c(be2->coeff, bd2->dqcoeff, 64); *distortion += thisdistortion; |