• Home
  • Raw
  • Download

Lines Matching refs:it

367 void VP8MakeLuma16Preds(const VP8EncIterator* const it) {  in VP8MakeLuma16Preds()  argument
368 const VP8Encoder* const enc = it->enc_; in VP8MakeLuma16Preds()
369 const uint8_t* const left = it->x_ ? enc->y_left_ : NULL; in VP8MakeLuma16Preds()
370 const uint8_t* const top = it->y_ ? enc->y_top_ + it->x_ * 16 : NULL; in VP8MakeLuma16Preds()
371 VP8EncPredLuma16(it->yuv_p_, left, top); in VP8MakeLuma16Preds()
374 void VP8MakeChroma8Preds(const VP8EncIterator* const it) { in VP8MakeChroma8Preds() argument
375 const VP8Encoder* const enc = it->enc_; in VP8MakeChroma8Preds()
376 const uint8_t* const left = it->x_ ? enc->u_left_ : NULL; in VP8MakeChroma8Preds()
377 const uint8_t* const top = it->y_ ? enc->uv_top_ + it->x_ * 16 : NULL; in VP8MakeChroma8Preds()
378 VP8EncPredChroma8(it->yuv_p_, left, top); in VP8MakeChroma8Preds()
381 void VP8MakeIntra4Preds(const VP8EncIterator* const it) { in VP8MakeIntra4Preds() argument
382 VP8EncPredLuma4(it->yuv_p_, it->i4_top_); in VP8MakeIntra4Preds()
485 static int TrellisQuantizeBlock(const VP8EncIterator* const it, in TrellisQuantizeBlock() argument
490 ProbaArray* const last_costs = it->enc_->proba_.coeffs_[coeff_type]; in TrellisQuantizeBlock()
491 CostArray* const costs = it->enc_->proba_.level_cost_[coeff_type]; in TrellisQuantizeBlock()
645 static int ReconstructIntra16(VP8EncIterator* const it, in ReconstructIntra16() argument
649 const VP8Encoder* const enc = it->enc_; in ReconstructIntra16()
650 const uint8_t* const ref = it->yuv_p_ + VP8I16ModeOffsets[mode]; in ReconstructIntra16()
651 const uint8_t* const src = it->yuv_in_ + Y_OFF; in ReconstructIntra16()
652 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in ReconstructIntra16()
663 if (DO_TRELLIS_I16 && it->do_trellis_) { in ReconstructIntra16()
665 VP8IteratorNzToBytes(it); in ReconstructIntra16()
668 const int ctx = it->top_nz_[x] + it->left_nz_[y]; in ReconstructIntra16()
670 TrellisQuantizeBlock(it, tmp[n], rd->y_ac_levels[n], ctx, 0, in ReconstructIntra16()
672 it->top_nz_[x] = it->left_nz_[y] = non_zero; in ReconstructIntra16()
691 static int ReconstructIntra4(VP8EncIterator* const it, in ReconstructIntra4() argument
696 const VP8Encoder* const enc = it->enc_; in ReconstructIntra4()
697 const uint8_t* const ref = it->yuv_p_ + VP8I4ModeOffsets[mode]; in ReconstructIntra4()
698 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in ReconstructIntra4()
703 if (DO_TRELLIS_I4 && it->do_trellis_) { in ReconstructIntra4()
704 const int x = it->i4_ & 3, y = it->i4_ >> 2; in ReconstructIntra4()
705 const int ctx = it->top_nz_[x] + it->left_nz_[y]; in ReconstructIntra4()
706 nz = TrellisQuantizeBlock(it, tmp, levels, ctx, 3, &dqm->y1_, in ReconstructIntra4()
715 static int ReconstructUV(VP8EncIterator* const it, VP8ModeScore* const rd, in ReconstructUV() argument
717 const VP8Encoder* const enc = it->enc_; in ReconstructUV()
718 const uint8_t* const ref = it->yuv_p_ + VP8UVModeOffsets[mode]; in ReconstructUV()
719 const uint8_t* const src = it->yuv_in_ + U_OFF; in ReconstructUV()
720 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in ReconstructUV()
728 if (DO_TRELLIS_UV && it->do_trellis_) { in ReconstructUV()
733 const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; in ReconstructUV()
735 TrellisQuantizeBlock(it, tmp[n], rd->uv_levels[n], ctx, 2, in ReconstructUV()
737 it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = non_zero; in ReconstructUV()
764 static void SwapOut(VP8EncIterator* const it) { in SwapOut() argument
765 SwapPtr(&it->yuv_out_, &it->yuv_out2_); in SwapOut()
768 static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* const rd) { in PickBestIntra16() argument
769 const VP8Encoder* const enc = it->enc_; in PickBestIntra16()
770 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in PickBestIntra16()
773 const uint8_t* const src = it->yuv_in_ + Y_OFF; in PickBestIntra16()
779 uint8_t* const tmp_dst = it->yuv_out2_ + Y_OFF; // scratch buffer in PickBestIntra16()
783 nz = ReconstructIntra16(it, &rd16, tmp_dst, mode); in PickBestIntra16()
789 rd16.R = VP8GetCostLuma16(it, &rd16); in PickBestIntra16()
800 SwapOut(it); in PickBestIntra16()
804 VP8SetIntra16Mode(it, rd->mode_i16); in PickBestIntra16()
810 static const uint16_t* GetCostModeI4(VP8EncIterator* const it, in GetCostModeI4() argument
812 const int preds_w = it->enc_->preds_w_; in GetCostModeI4()
813 const int x = (it->i4_ & 3), y = it->i4_ >> 2; in GetCostModeI4()
814 const int left = (x == 0) ? it->preds_[y * preds_w - 1] : modes[it->i4_ - 1]; in GetCostModeI4()
815 const int top = (y == 0) ? it->preds_[-preds_w + x] : modes[it->i4_ - 4]; in GetCostModeI4()
819 static int PickBestIntra4(VP8EncIterator* const it, VP8ModeScore* const rd) { in PickBestIntra4() argument
820 const VP8Encoder* const enc = it->enc_; in PickBestIntra4()
821 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in PickBestIntra4()
824 const uint8_t* const src0 = it->yuv_in_ + Y_OFF; in PickBestIntra4()
825 uint8_t* const best_blocks = it->yuv_out2_ + Y_OFF; in PickBestIntra4()
835 VP8IteratorStartI4(it); in PickBestIntra4()
840 const uint8_t* const src = src0 + VP8Scan[it->i4_]; in PickBestIntra4()
841 const uint16_t* const mode_costs = GetCostModeI4(it, rd->modes_i4); in PickBestIntra4()
842 uint8_t* best_block = best_blocks + VP8Scan[it->i4_]; in PickBestIntra4()
843 uint8_t* tmp_dst = it->yuv_p_ + I4TMP; // scratch buffer. in PickBestIntra4()
846 VP8MakeIntra4Preds(it); in PickBestIntra4()
853 ReconstructIntra4(it, tmp_levels, src, tmp_dst, mode) << it->i4_; in PickBestIntra4()
860 rd_tmp.R = VP8GetCostLuma4(it, tmp_levels); in PickBestIntra4()
868 memcpy(rd_best.y_ac_levels[it->i4_], tmp_levels, sizeof(tmp_levels)); in PickBestIntra4()
879 if (best_block != best_blocks + VP8Scan[it->i4_]) in PickBestIntra4()
880 VP8Copy4x4(best_block, best_blocks + VP8Scan[it->i4_]); in PickBestIntra4()
881 rd->modes_i4[it->i4_] = best_mode; in PickBestIntra4()
882 it->top_nz_[it->i4_ & 3] = it->left_nz_[it->i4_ >> 2] = (rd_i4.nz ? 1 : 0); in PickBestIntra4()
883 } while (VP8IteratorRotateI4(it, best_blocks)); in PickBestIntra4()
887 VP8SetIntra4Mode(it, rd->modes_i4); in PickBestIntra4()
888 SwapOut(it); in PickBestIntra4()
895 static void PickBestUV(VP8EncIterator* const it, VP8ModeScore* const rd) { in PickBestUV() argument
896 const VP8Encoder* const enc = it->enc_; in PickBestUV()
897 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in PickBestUV()
899 const uint8_t* const src = it->yuv_in_ + U_OFF; in PickBestUV()
900 uint8_t* const tmp_dst = it->yuv_out2_ + U_OFF; // scratch buffer in PickBestUV()
901 uint8_t* const dst0 = it->yuv_out_ + U_OFF; in PickBestUV()
911 rd_uv.nz = ReconstructUV(it, &rd_uv, tmp_dst, mode); in PickBestUV()
916 rd_uv.R = VP8GetCostUV(it, &rd_uv); in PickBestUV()
927 VP8SetIntraUVMode(it, rd->mode_uv); in PickBestUV()
934 static void SimpleQuantize(VP8EncIterator* const it, VP8ModeScore* const rd) { in SimpleQuantize() argument
935 const VP8Encoder* const enc = it->enc_; in SimpleQuantize()
936 const int is_i16 = (it->mb_->type_ == 1); in SimpleQuantize()
940 nz = ReconstructIntra16(it, rd, it->yuv_out_ + Y_OFF, it->preds_[0]); in SimpleQuantize()
942 VP8IteratorStartI4(it); in SimpleQuantize()
945 it->preds_[(it->i4_ & 3) + (it->i4_ >> 2) * enc->preds_w_]; in SimpleQuantize()
946 const uint8_t* const src = it->yuv_in_ + Y_OFF + VP8Scan[it->i4_]; in SimpleQuantize()
947 uint8_t* const dst = it->yuv_out_ + Y_OFF + VP8Scan[it->i4_]; in SimpleQuantize()
948 VP8MakeIntra4Preds(it); in SimpleQuantize()
949 nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4_], in SimpleQuantize()
950 src, dst, mode) << it->i4_; in SimpleQuantize()
951 } while (VP8IteratorRotateI4(it, it->yuv_out_ + Y_OFF)); in SimpleQuantize()
954 nz |= ReconstructUV(it, rd, it->yuv_out_ + U_OFF, it->mb_->uv_mode_); in SimpleQuantize()
959 static void DistoRefine(VP8EncIterator* const it, int try_both_i4_i16) { in DistoRefine() argument
960 const int is_i16 = (it->mb_->type_ == 1); in DistoRefine()
967 const uint8_t* const ref = it->yuv_p_ + VP8I16ModeOffsets[mode]; in DistoRefine()
968 const uint8_t* const src = it->yuv_in_ + Y_OFF; in DistoRefine()
975 VP8SetIntra16Mode(it, best_mode); in DistoRefine()
983 VP8IteratorStartI4(it); in DistoRefine()
988 const uint8_t* const src = it->yuv_in_ + Y_OFF + VP8Scan[it->i4_]; in DistoRefine()
992 VP8MakeIntra4Preds(it); in DistoRefine()
994 const uint8_t* const ref = it->yuv_p_ + VP8I4ModeOffsets[mode]; in DistoRefine()
1001 modes_i4[it->i4_] = best_sub_mode; in DistoRefine()
1004 } while (VP8IteratorRotateI4(it, it->yuv_in_ + Y_OFF)); in DistoRefine()
1006 VP8SetIntra4Mode(it, modes_i4); in DistoRefine()
1014 int VP8Decimate(VP8EncIterator* const it, VP8ModeScore* const rd, in VP8Decimate() argument
1017 const int method = it->enc_->method_; in VP8Decimate()
1023 VP8MakeLuma16Preds(it); in VP8Decimate()
1024 VP8MakeChroma8Preds(it); in VP8Decimate()
1027 it->do_trellis_ = (rd_opt >= RD_OPT_TRELLIS_ALL); in VP8Decimate()
1028 PickBestIntra16(it, rd); in VP8Decimate()
1030 PickBestIntra4(it, rd); in VP8Decimate()
1032 PickBestUV(it, rd); in VP8Decimate()
1034 it->do_trellis_ = 1; in VP8Decimate()
1035 SimpleQuantize(it, rd); in VP8Decimate()
1040 DistoRefine(it, (method >= 2)); in VP8Decimate()
1041 SimpleQuantize(it, rd); in VP8Decimate()
1044 VP8SetSkip(it, is_skipped); in VP8Decimate()