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

Side by Side Diff: source/libvpx/vp9/encoder/vp9_encodemb.c

Issue 290653003: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 7 months 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
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 int idx, int token, 92 int idx, int token,
93 uint8_t *token_cache) { 93 uint8_t *token_cache) {
94 int bak = token_cache[scan[idx]], pt; 94 int bak = token_cache[scan[idx]], pt;
95 token_cache[scan[idx]] = vp9_pt_energy_class[token]; 95 token_cache[scan[idx]] = vp9_pt_energy_class[token];
96 pt = get_coef_context(nb, token_cache, idx + 1); 96 pt = get_coef_context(nb, token_cache, idx + 1);
97 token_cache[scan[idx]] = bak; 97 token_cache[scan[idx]] = bak;
98 return pt; 98 return pt;
99 } 99 }
100 100
101 static int optimize_b(MACROBLOCK *mb, int plane, int block, 101 static int optimize_b(MACROBLOCK *mb, int plane, int block,
102 BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int ctx) { 102 TX_SIZE tx_size, int ctx) {
103 MACROBLOCKD *const xd = &mb->e_mbd; 103 MACROBLOCKD *const xd = &mb->e_mbd;
104 struct macroblock_plane *const p = &mb->plane[plane]; 104 struct macroblock_plane *const p = &mb->plane[plane];
105 struct macroblockd_plane *const pd = &xd->plane[plane]; 105 struct macroblockd_plane *const pd = &xd->plane[plane];
106 const int ref = is_inter_block(&xd->mi[0]->mbmi); 106 const int ref = is_inter_block(&xd->mi[0]->mbmi);
107 vp9_token_state tokens[1025][2]; 107 vp9_token_state tokens[1025][2];
108 unsigned best_index[1025][2]; 108 unsigned best_index[1025][2];
109 uint8_t token_cache[1024]; 109 uint8_t token_cache[1024];
110 const int16_t *const coeff = BLOCK_OFFSET(mb->plane[plane].coeff, block); 110 const int16_t *const coeff = BLOCK_OFFSET(mb->plane[plane].coeff, block);
111 int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block); 111 int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
112 int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); 112 int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 p->eobs[block] = 0; 374 p->eobs[block] = 0;
375 *a = *l = 0; 375 *a = *l = 0;
376 return; 376 return;
377 } 377 }
378 378
379 if (!x->skip_recode) 379 if (!x->skip_recode)
380 vp9_xform_quant(x, plane, block, plane_bsize, tx_size); 380 vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
381 381
382 if (x->optimize && (!x->skip_recode || !x->skip_optimize)) { 382 if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
383 const int ctx = combine_entropy_contexts(*a, *l); 383 const int ctx = combine_entropy_contexts(*a, *l);
384 *a = *l = optimize_b(x, plane, block, plane_bsize, tx_size, ctx) > 0; 384 *a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0;
385 } else { 385 } else {
386 *a = *l = p->eobs[block] > 0; 386 *a = *l = p->eobs[block] > 0;
387 } 387 }
388 388
389 if (p->eobs[block]) 389 if (p->eobs[block])
390 *(args->skip) = 0; 390 *(args->skip) = 0;
391 391
392 if (x->skip_encode || p->eobs[block] == 0) 392 if (x->skip_encode || p->eobs[block] == 0)
393 return; 393 return;
394 394
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 } 594 }
595 595
596 596
597 void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) { 597 void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
598 const MACROBLOCKD *const xd = &x->e_mbd; 598 const MACROBLOCKD *const xd = &x->e_mbd;
599 struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip}; 599 struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip};
600 600
601 vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block_intra, 601 vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block_intra,
602 &arg); 602 &arg);
603 } 603 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698