OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 x->plane[i].quant_thred[0] = x->plane[i].zbin[0] * x->plane[i].zbin[0]; | 676 x->plane[i].quant_thred[0] = x->plane[i].zbin[0] * x->plane[i].zbin[0]; |
677 x->plane[i].quant_thred[1] = x->plane[i].zbin[1] * x->plane[i].zbin[1]; | 677 x->plane[i].quant_thred[1] = x->plane[i].zbin[1] * x->plane[i].zbin[1]; |
678 } | 678 } |
679 | 679 |
680 x->skip_block = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP); | 680 x->skip_block = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP); |
681 x->q_index = qindex; | 681 x->q_index = qindex; |
682 | 682 |
683 x->errorperbit = rdmult >> 6; | 683 x->errorperbit = rdmult >> 6; |
684 x->errorperbit += (x->errorperbit == 0); | 684 x->errorperbit += (x->errorperbit == 0); |
685 | 685 |
686 vp9_initialize_me_consts(cpi, x->q_index); | 686 vp9_initialize_me_consts(cpi, x, x->q_index); |
687 } | 687 } |
688 | 688 |
689 void vp9_frame_init_quantizer(VP9_COMP *cpi) { | 689 void vp9_frame_init_quantizer(VP9_COMP *cpi) { |
690 vp9_init_plane_quantizers(cpi, &cpi->td.mb); | 690 vp9_init_plane_quantizers(cpi, &cpi->td.mb); |
691 } | 691 } |
692 | 692 |
693 void vp9_set_quantizer(VP9_COMMON *cm, int q) { | 693 void vp9_set_quantizer(VP9_COMMON *cm, int q) { |
694 // quantizer has to be reinitialized with vp9_init_quantizer() if any | 694 // quantizer has to be reinitialized with vp9_init_quantizer() if any |
695 // delta_q changes. | 695 // delta_q changes. |
696 cm->base_qindex = q; | 696 cm->base_qindex = q; |
(...skipping 21 matching lines...) Expand all Loading... |
718 | 718 |
719 int vp9_qindex_to_quantizer(int qindex) { | 719 int vp9_qindex_to_quantizer(int qindex) { |
720 int quantizer; | 720 int quantizer; |
721 | 721 |
722 for (quantizer = 0; quantizer < 64; ++quantizer) | 722 for (quantizer = 0; quantizer < 64; ++quantizer) |
723 if (quantizer_to_qindex[quantizer] >= qindex) | 723 if (quantizer_to_qindex[quantizer] >= qindex) |
724 return quantizer; | 724 return quantizer; |
725 | 725 |
726 return 63; | 726 return 63; |
727 } | 727 } |
OLD | NEW |