Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: source/libvpx/vp8/encoder/quantize.c

Issue 756673003: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp8/encoder/quantize.h ('k') | source/libvpx/vp8/encoder/vp8_asm_enc_offsets.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 { 94 {
95 eob = i; /* last nonzero coeffs */ 95 eob = i; /* last nonzero coeffs */
96 zbin_boost_ptr = b->zrun_zbin_boost; /* reset zero runlength */ 96 zbin_boost_ptr = b->zrun_zbin_boost; /* reset zero runlength */
97 } 97 }
98 } 98 }
99 } 99 }
100 100
101 *d->eob = (char)(eob + 1); 101 *d->eob = (char)(eob + 1);
102 } 102 }
103 103
104 void vp8_quantize_mby_c(MACROBLOCK *x) 104 void vp8_quantize_mby(MACROBLOCK *x)
105 { 105 {
106 int i; 106 int i;
107 int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED 107 int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
108 && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); 108 && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
109 109
110 for (i = 0; i < 16; i++) 110 for (i = 0; i < 16; i++)
111 x->quantize_b(&x->block[i], &x->e_mbd.block[i]); 111 x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
112 112
113 if(has_2nd_order) 113 if(has_2nd_order)
114 x->quantize_b(&x->block[24], &x->e_mbd.block[24]); 114 x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
115 } 115 }
116 116
117 void vp8_quantize_mb_c(MACROBLOCK *x) 117 void vp8_quantize_mb(MACROBLOCK *x)
118 { 118 {
119 int i; 119 int i;
120 int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED 120 int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED
121 && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV); 121 && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
122 122
123 for (i = 0; i < 24+has_2nd_order; i++) 123 for (i = 0; i < 24+has_2nd_order; i++)
124 x->quantize_b(&x->block[i], &x->e_mbd.block[i]); 124 x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
125 } 125 }
126 126
127 127
128 void vp8_quantize_mbuv_c(MACROBLOCK *x) 128 void vp8_quantize_mbuv(MACROBLOCK *x)
129 { 129 {
130 int i; 130 int i;
131 131
132 for (i = 16; i < 24; i++) 132 for (i = 16; i < 24; i++)
133 x->quantize_b(&x->block[i], &x->e_mbd.block[i]); 133 x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
134 } 134 }
135 135
136 /* quantize_b_pair function pointer in MACROBLOCK structure is set to one of
137 * these two C functions if corresponding optimized routine is not available.
138 * NEON optimized version implements currently the fast quantization for pair
139 * of blocks. */
140 void vp8_regular_quantize_b_pair(BLOCK *b1, BLOCK *b2, BLOCKD *d1, BLOCKD *d2)
141 {
142 vp8_regular_quantize_b(b1, d1);
143 vp8_regular_quantize_b(b2, d2);
144 }
145
146 void vp8_fast_quantize_b_pair_c(BLOCK *b1, BLOCK *b2, BLOCKD *d1, BLOCKD *d2)
147 {
148 vp8_fast_quantize_b_c(b1, d1);
149 vp8_fast_quantize_b_c(b2, d2);
150 }
151
152
153 static const int qrounding_factors[129] = 136 static const int qrounding_factors[129] =
154 { 137 {
155 48, 48, 48, 48, 48, 48, 48, 48, 138 48, 48, 48, 48, 48, 48, 48, 48,
156 48, 48, 48, 48, 48, 48, 48, 48, 139 48, 48, 48, 48, 48, 48, 48, 48,
157 48, 48, 48, 48, 48, 48, 48, 48, 140 48, 48, 48, 48, 48, 48, 48, 48,
158 48, 48, 48, 48, 48, 48, 48, 48, 141 48, 48, 48, 48, 48, 48, 48, 48,
159 48, 48, 48, 48, 48, 48, 48, 48, 142 48, 48, 48, 48, 48, 48, 48, 48,
160 48, 48, 48, 48, 48, 48, 48, 48, 143 48, 48, 48, 48, 48, 48, 48, 48,
161 48, 48, 48, 48, 48, 48, 48, 48, 144 48, 48, 48, 48, 48, 48, 48, 48,
162 48, 48, 48, 48, 48, 48, 48, 48, 145 48, 48, 48, 48, 48, 48, 48, 48,
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LV L_ALT_Q][0]; 560 mbd->segment_feature_data[MB_LVL_ALT_Q][0] = cpi->segment_feature_data[MB_LV L_ALT_Q][0];
578 mbd->segment_feature_data[MB_LVL_ALT_Q][1] = cpi->segment_feature_data[MB_LV L_ALT_Q][1]; 561 mbd->segment_feature_data[MB_LVL_ALT_Q][1] = cpi->segment_feature_data[MB_LV L_ALT_Q][1];
579 mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LV L_ALT_Q][2]; 562 mbd->segment_feature_data[MB_LVL_ALT_Q][2] = cpi->segment_feature_data[MB_LV L_ALT_Q][2];
580 mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LV L_ALT_Q][3]; 563 mbd->segment_feature_data[MB_LVL_ALT_Q][3] = cpi->segment_feature_data[MB_LV L_ALT_Q][3];
581 564
582 /* quantizer has to be reinitialized for any delta_q changes */ 565 /* quantizer has to be reinitialized for any delta_q changes */
583 if(update) 566 if(update)
584 vp8cx_init_quantizer(cpi); 567 vp8cx_init_quantizer(cpi);
585 568
586 } 569 }
OLDNEW
« no previous file with comments | « source/libvpx/vp8/encoder/quantize.h ('k') | source/libvpx/vp8/encoder/vp8_asm_enc_offsets.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698