| Index: source/libvpx/vp9/encoder/vp9_tokenize.c
|
| ===================================================================
|
| --- source/libvpx/vp9/encoder/vp9_tokenize.c (revision 263011)
|
| +++ source/libvpx/vp9/encoder/vp9_tokenize.c (working copy)
|
| @@ -8,19 +8,21 @@
|
| * be found in the AUTHORS file in the root of the source tree.
|
| */
|
|
|
| -
|
| +#include <assert.h>
|
| #include <math.h>
|
| #include <stdio.h>
|
| #include <string.h>
|
| -#include <assert.h>
|
| -#include "vp9/encoder/vp9_onyx_int.h"
|
| -#include "vp9/encoder/vp9_tokenize.h"
|
| +
|
| #include "vpx_mem/vpx_mem.h"
|
|
|
| +#include "vp9/common/vp9_entropy.h"
|
| #include "vp9/common/vp9_pred_common.h"
|
| #include "vp9/common/vp9_seg_common.h"
|
| -#include "vp9/common/vp9_entropy.h"
|
|
|
| +#include "vp9/encoder/vp9_cost.h"
|
| +#include "vp9/encoder/vp9_onyx_int.h"
|
| +#include "vp9/encoder/vp9_tokenize.h"
|
| +
|
| static TOKENVALUE dct_value_tokens[DCT_MAX_VALUE * 2];
|
| const TOKENVALUE *vp9_dct_value_tokens_ptr;
|
| static int16_t dct_value_cost[DCT_MAX_VALUE * 2];
|
| @@ -106,7 +108,7 @@
|
| vp9_tokens_from_tree(vp9_coef_encodings, vp9_coef_tree);
|
| }
|
|
|
| -static void fill_value_tokens() {
|
| +void vp9_tokenize_initialize() {
|
| TOKENVALUE *const t = dct_value_tokens + DCT_MAX_VALUE;
|
| const vp9_extra_bit *const e = vp9_extra_bits;
|
|
|
| @@ -160,7 +162,6 @@
|
| VP9_COMP *cpi;
|
| MACROBLOCKD *xd;
|
| TOKENEXTRA **tp;
|
| - uint8_t *token_cache;
|
| };
|
|
|
| static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
|
| @@ -211,10 +212,10 @@
|
| VP9_COMP *cpi = args->cpi;
|
| MACROBLOCKD *xd = args->xd;
|
| TOKENEXTRA **tp = args->tp;
|
| - uint8_t *token_cache = args->token_cache;
|
| + uint8_t token_cache[32 * 32];
|
| struct macroblock_plane *p = &cpi->mb.plane[plane];
|
| struct macroblockd_plane *pd = &xd->plane[plane];
|
| - MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
|
| + MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
|
| int pt; /* near block/prev token context index */
|
| int c;
|
| TOKENEXTRA *t = *tp; /* store tokens starting here */
|
| @@ -296,13 +297,6 @@
|
| args->skippable[0] &= (!args->x->plane[plane].eobs[block]);
|
| }
|
|
|
| -static int sb_is_skippable(MACROBLOCK *x, BLOCK_SIZE bsize) {
|
| - int result = 1;
|
| - struct is_skippable_args args = {x, &result};
|
| - vp9_foreach_transformed_block(&x->e_mbd, bsize, is_skippable, &args);
|
| - return result;
|
| -}
|
| -
|
| int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
|
| int result = 1;
|
| struct is_skippable_args args = {x, &result};
|
| @@ -315,12 +309,12 @@
|
| BLOCK_SIZE bsize) {
|
| VP9_COMMON *const cm = &cpi->common;
|
| MACROBLOCKD *const xd = &cpi->mb.e_mbd;
|
| - MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
| + MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
|
| TOKENEXTRA *t_backup = *t;
|
| const int ctx = vp9_get_skip_context(xd);
|
| const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
|
| SEG_LVL_SKIP);
|
| - struct tokenize_b_args arg = {cpi, xd, t, cpi->mb.token_cache};
|
| + struct tokenize_b_args arg = {cpi, xd, t};
|
| if (mbmi->skip) {
|
| if (!dry_run)
|
| cm->counts.skip[ctx][1] += skip_inc;
|
| @@ -338,7 +332,3 @@
|
| *t = t_backup;
|
| }
|
| }
|
| -
|
| -void vp9_tokenize_initialize() {
|
| - fill_value_tokens();
|
| -}
|
|
|