Lines Matching refs:it
301 void VP8MakeLuma16Preds(const VP8EncIterator* const it) { in VP8MakeLuma16Preds() argument
302 VP8Encoder* const enc = it->enc_; in VP8MakeLuma16Preds()
303 const uint8_t* left = it->x_ ? enc->y_left_ : NULL; in VP8MakeLuma16Preds()
304 const uint8_t* top = it->y_ ? enc->y_top_ + it->x_ * 16 : NULL; in VP8MakeLuma16Preds()
305 VP8EncPredLuma16(it->yuv_p_, left, top); in VP8MakeLuma16Preds()
308 void VP8MakeChroma8Preds(const VP8EncIterator* const it) { in VP8MakeChroma8Preds() argument
309 VP8Encoder* const enc = it->enc_; in VP8MakeChroma8Preds()
310 const uint8_t* left = it->x_ ? enc->u_left_ : NULL; in VP8MakeChroma8Preds()
311 const uint8_t* top = it->y_ ? enc->uv_top_ + it->x_ * 16 : NULL; in VP8MakeChroma8Preds()
312 VP8EncPredChroma8(it->yuv_p_, left, top); in VP8MakeChroma8Preds()
315 void VP8MakeIntra4Preds(const VP8EncIterator* const it) { in VP8MakeIntra4Preds() argument
316 VP8EncPredLuma4(it->yuv_p_, it->i4_top_); in VP8MakeIntra4Preds()
419 static int TrellisQuantizeBlock(const VP8EncIterator* const it, in TrellisQuantizeBlock() argument
424 ProbaArray* const last_costs = it->enc_->proba_.coeffs_[coeff_type]; in TrellisQuantizeBlock()
425 CostArray* const costs = it->enc_->proba_.level_cost_[coeff_type]; in TrellisQuantizeBlock()
579 static int ReconstructIntra16(VP8EncIterator* const it, in ReconstructIntra16() argument
583 const VP8Encoder* const enc = it->enc_; in ReconstructIntra16()
584 const uint8_t* const ref = it->yuv_p_ + VP8I16ModeOffsets[mode]; in ReconstructIntra16()
585 const uint8_t* const src = it->yuv_in_ + Y_OFF; in ReconstructIntra16()
586 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in ReconstructIntra16()
597 if (DO_TRELLIS_I16 && it->do_trellis_) { in ReconstructIntra16()
599 VP8IteratorNzToBytes(it); in ReconstructIntra16()
602 const int ctx = it->top_nz_[x] + it->left_nz_[y]; in ReconstructIntra16()
604 TrellisQuantizeBlock(it, tmp[n], rd->y_ac_levels[n], ctx, 0, in ReconstructIntra16()
606 it->top_nz_[x] = it->left_nz_[y] = non_zero; in ReconstructIntra16()
625 static int ReconstructIntra4(VP8EncIterator* const it, in ReconstructIntra4() argument
630 const VP8Encoder* const enc = it->enc_; in ReconstructIntra4()
631 const uint8_t* const ref = it->yuv_p_ + VP8I4ModeOffsets[mode]; in ReconstructIntra4()
632 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in ReconstructIntra4()
637 if (DO_TRELLIS_I4 && it->do_trellis_) { in ReconstructIntra4()
638 const int x = it->i4_ & 3, y = it->i4_ >> 2; in ReconstructIntra4()
639 const int ctx = it->top_nz_[x] + it->left_nz_[y]; in ReconstructIntra4()
640 nz = TrellisQuantizeBlock(it, tmp, levels, ctx, 3, &dqm->y1_, in ReconstructIntra4()
649 static int ReconstructUV(VP8EncIterator* const it, VP8ModeScore* const rd, in ReconstructUV() argument
651 const VP8Encoder* const enc = it->enc_; in ReconstructUV()
652 const uint8_t* const ref = it->yuv_p_ + VP8UVModeOffsets[mode]; in ReconstructUV()
653 const uint8_t* const src = it->yuv_in_ + U_OFF; in ReconstructUV()
654 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in ReconstructUV()
662 if (DO_TRELLIS_UV && it->do_trellis_) { in ReconstructUV()
667 const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; in ReconstructUV()
669 TrellisQuantizeBlock(it, tmp[n], rd->uv_levels[n], ctx, 2, in ReconstructUV()
671 it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = non_zero; in ReconstructUV()
698 static void SwapOut(VP8EncIterator* const it) { in SwapOut() argument
699 SwapPtr(&it->yuv_out_, &it->yuv_out2_); in SwapOut()
702 static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* const rd) { in PickBestIntra16() argument
703 VP8Encoder* const enc = it->enc_; in PickBestIntra16()
704 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in PickBestIntra16()
707 const uint8_t* const src = it->yuv_in_ + Y_OFF; in PickBestIntra16()
713 uint8_t* const tmp_dst = it->yuv_out2_ + Y_OFF; // scratch buffer in PickBestIntra16()
717 nz = ReconstructIntra16(it, &rd16, tmp_dst, mode); in PickBestIntra16()
723 rd16.R = VP8GetCostLuma16(it, &rd16); in PickBestIntra16()
734 SwapOut(it); in PickBestIntra16()
738 VP8SetIntra16Mode(it, rd->mode_i16); in PickBestIntra16()
744 static const uint16_t* GetCostModeI4(VP8EncIterator* const it, in GetCostModeI4() argument
746 const int preds_w = it->enc_->preds_w_; in GetCostModeI4()
747 const int x = (it->i4_ & 3), y = it->i4_ >> 2; in GetCostModeI4()
748 const int left = (x == 0) ? it->preds_[y * preds_w - 1] : modes[it->i4_ - 1]; in GetCostModeI4()
749 const int top = (y == 0) ? it->preds_[-preds_w + x] : modes[it->i4_ - 4]; in GetCostModeI4()
753 static int PickBestIntra4(VP8EncIterator* const it, VP8ModeScore* const rd) { in PickBestIntra4() argument
754 VP8Encoder* const enc = it->enc_; in PickBestIntra4()
755 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in PickBestIntra4()
758 const uint8_t* const src0 = it->yuv_in_ + Y_OFF; in PickBestIntra4()
759 uint8_t* const best_blocks = it->yuv_out2_ + Y_OFF; in PickBestIntra4()
764 VP8IteratorStartI4(it); in PickBestIntra4()
769 const uint8_t* const src = src0 + VP8Scan[it->i4_]; in PickBestIntra4()
770 const uint16_t* const mode_costs = GetCostModeI4(it, rd->modes_i4); in PickBestIntra4()
771 uint8_t* best_block = best_blocks + VP8Scan[it->i4_]; in PickBestIntra4()
772 uint8_t* tmp_dst = it->yuv_p_ + I4TMP; // scratch buffer. in PickBestIntra4()
775 VP8MakeIntra4Preds(it); in PickBestIntra4()
782 ReconstructIntra4(it, tmp_levels, src, tmp_dst, mode) << it->i4_; in PickBestIntra4()
789 rd_tmp.R = VP8GetCostLuma4(it, tmp_levels); in PickBestIntra4()
797 memcpy(rd_best.y_ac_levels[it->i4_], tmp_levels, sizeof(tmp_levels)); in PickBestIntra4()
806 if (best_block != best_blocks + VP8Scan[it->i4_]) in PickBestIntra4()
807 VP8Copy4x4(best_block, best_blocks + VP8Scan[it->i4_]); in PickBestIntra4()
808 rd->modes_i4[it->i4_] = best_mode; in PickBestIntra4()
809 it->top_nz_[it->i4_ & 3] = it->left_nz_[it->i4_ >> 2] = (rd_i4.nz ? 1 : 0); in PickBestIntra4()
810 } while (VP8IteratorRotateI4(it, best_blocks)); in PickBestIntra4()
814 VP8SetIntra4Mode(it, rd->modes_i4); in PickBestIntra4()
815 SwapOut(it); in PickBestIntra4()
822 static void PickBestUV(VP8EncIterator* const it, VP8ModeScore* const rd) { in PickBestUV() argument
823 VP8Encoder* const enc = it->enc_; in PickBestUV()
824 const VP8SegmentInfo* const dqm = &enc->dqm_[it->mb_->segment_]; in PickBestUV()
826 const uint8_t* const src = it->yuv_in_ + U_OFF; in PickBestUV()
827 uint8_t* const tmp_dst = it->yuv_out2_ + U_OFF; // scratch buffer in PickBestUV()
828 uint8_t* const dst0 = it->yuv_out_ + U_OFF; in PickBestUV()
838 rd_uv.nz = ReconstructUV(it, &rd_uv, tmp_dst, mode); in PickBestUV()
843 rd_uv.R = VP8GetCostUV(it, &rd_uv); in PickBestUV()
854 VP8SetIntraUVMode(it, rd->mode_uv); in PickBestUV()
861 static void SimpleQuantize(VP8EncIterator* const it, VP8ModeScore* const rd) { in SimpleQuantize() argument
862 const VP8Encoder* const enc = it->enc_; in SimpleQuantize()
863 const int i16 = (it->mb_->type_ == 1); in SimpleQuantize()
867 nz = ReconstructIntra16(it, rd, it->yuv_out_ + Y_OFF, it->preds_[0]); in SimpleQuantize()
869 VP8IteratorStartI4(it); in SimpleQuantize()
872 it->preds_[(it->i4_ & 3) + (it->i4_ >> 2) * enc->preds_w_]; in SimpleQuantize()
873 const uint8_t* const src = it->yuv_in_ + Y_OFF + VP8Scan[it->i4_]; in SimpleQuantize()
874 uint8_t* const dst = it->yuv_out_ + Y_OFF + VP8Scan[it->i4_]; in SimpleQuantize()
875 VP8MakeIntra4Preds(it); in SimpleQuantize()
876 nz |= ReconstructIntra4(it, rd->y_ac_levels[it->i4_], in SimpleQuantize()
877 src, dst, mode) << it->i4_; in SimpleQuantize()
878 } while (VP8IteratorRotateI4(it, it->yuv_out_ + Y_OFF)); in SimpleQuantize()
881 nz |= ReconstructUV(it, rd, it->yuv_out_ + U_OFF, it->mb_->uv_mode_); in SimpleQuantize()
888 int VP8Decimate(VP8EncIterator* const it, VP8ModeScore* const rd, int rd_opt) { in VP8Decimate() argument
895 VP8MakeLuma16Preds(it); in VP8Decimate()
896 VP8MakeChroma8Preds(it); in VP8Decimate()
901 it->do_trellis_ = (rd_opt > 2); in VP8Decimate()
902 PickBestIntra16(it, rd); in VP8Decimate()
903 if (it->enc_->method_ >= 2) { in VP8Decimate()
904 PickBestIntra4(it, rd); in VP8Decimate()
906 PickBestUV(it, rd); in VP8Decimate()
908 it->do_trellis_ = 1; in VP8Decimate()
909 SimpleQuantize(it, rd); in VP8Decimate()
913 it->do_trellis_ = (it->enc_->method_ == 2); in VP8Decimate()
914 SimpleQuantize(it, rd); in VP8Decimate()
917 VP8SetSkip(it, is_skipped); in VP8Decimate()