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

Unified Diff: source/libvpx/vp9/encoder/vp9_tokenize.c

Issue 23530058: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_temporal_filter.c ('k') | source/libvpx/vp9/encoder/x86/vp9_dct32x32_sse2.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_tokenize.c
===================================================================
--- source/libvpx/vp9/encoder/vp9_tokenize.c (revision 223100)
+++ source/libvpx/vp9/encoder/vp9_tokenize.c (working copy)
@@ -114,23 +114,23 @@
MACROBLOCKD *xd = args->xd;
TOKENEXTRA **tp = args->tp;
struct macroblockd_plane *pd = &xd->plane[plane];
- MB_MODE_INFO *mbmi = &xd->mode_info_context->mbmi;
+ MB_MODE_INFO *mbmi = &xd->this_mi->mbmi;
int pt; /* near block/prev token context index */
int c = 0, rc = 0;
TOKENEXTRA *t = *tp; /* store tokens starting here */
const int eob = pd->eobs[block];
const PLANE_TYPE type = pd->plane_type;
const int16_t *qcoeff_ptr = BLOCK_OFFSET(pd->qcoeff, block);
- int seg_eob;
+
const int segment_id = mbmi->segment_id;
const int16_t *scan, *nb;
vp9_coeff_count *const counts = cpi->coef_counts[tx_size];
vp9_coeff_probs_model *const coef_probs = cpi->common.fc.coef_probs[tx_size];
const int ref = is_inter_block(mbmi);
- ENTROPY_CONTEXT above_ec, left_ec;
uint8_t token_cache[1024];
const uint8_t *band_translate;
ENTROPY_CONTEXT *A, *L;
+ const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size);
int aoff, loff;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
@@ -139,45 +139,9 @@
assert((!type && !plane) || (type && plane));
- switch (tx_size) {
- case TX_4X4:
- above_ec = A[0] != 0;
- left_ec = L[0] != 0;
- seg_eob = 16;
- scan = get_scan_4x4(get_tx_type_4x4(type, xd, block));
- band_translate = vp9_coefband_trans_4x4;
- break;
- case TX_8X8:
- above_ec = !!*(uint16_t *)A;
- left_ec = !!*(uint16_t *)L;
- seg_eob = 64;
- scan = get_scan_8x8(get_tx_type_8x8(type, xd));
- band_translate = vp9_coefband_trans_8x8plus;
- break;
- case TX_16X16:
- above_ec = !!*(uint32_t *)A;
- left_ec = !!*(uint32_t *)L;
- seg_eob = 256;
- scan = get_scan_16x16(get_tx_type_16x16(type, xd));
- band_translate = vp9_coefband_trans_8x8plus;
- break;
- case TX_32X32:
- above_ec = !!*(uint64_t *)A;
- left_ec = !!*(uint64_t *)L;
- seg_eob = 1024;
- scan = vp9_default_scan_32x32;
- band_translate = vp9_coefband_trans_8x8plus;
- break;
- default:
- assert(!"Invalid transform size");
- }
-
- pt = combine_entropy_contexts(above_ec, left_ec);
+ pt = get_entropy_context(xd, tx_size, type, block, A, L,
+ &scan, &band_translate);
nb = vp9_get_coef_neighbors_handle(scan);
-
- if (vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP))
- seg_eob = 0;
-
c = 0;
do {
const int band = get_coef_band(band_translate, c);
@@ -246,12 +210,12 @@
BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
- MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
+ MB_MODE_INFO *const mbmi = &xd->this_mi->mbmi;
TOKENEXTRA *t_backup = *t;
const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
SEG_LVL_SKIP);
- struct tokenize_b_args arg = {cpi, xd, t, mbmi->txfm_size};
+ struct tokenize_b_args arg = {cpi, xd, t, mbmi->tx_size};
mbmi->skip_coeff = vp9_sb_is_skippable(xd, bsize);
if (mbmi->skip_coeff) {
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_temporal_filter.c ('k') | source/libvpx/vp9/encoder/x86/vp9_dct32x32_sse2.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698