summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2014-10-09 11:12:02 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-10-09 11:12:02 -0700
commit9ffbc31367668034538c1af707f430e463f022a1 (patch)
tree5fc284b6ca1ce1d691266f022bc36cd10a1acd9c
parenta007ec0f7f517d14acd94691c437ef7180519b45 (diff)
parent5fcbcf1b22a92a2c13381b91c216200f073e0b74 (diff)
downloadlibvpx-9ffbc31367668034538c1af707f430e463f022a1.tar
libvpx-9ffbc31367668034538c1af707f430e463f022a1.tar.gz
libvpx-9ffbc31367668034538c1af707f430e463f022a1.tar.bz2
libvpx-9ffbc31367668034538c1af707f430e463f022a1.zip
Merge "Move the high freq coeff check outside store_coding_context"
-rw-r--r--vp9/encoder/vp9_rdopt.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 3d3a5dcf8..5c730049c 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1973,27 +1973,11 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS],
int skippable) {
MACROBLOCKD *const xd = &x->e_mbd;
- int plane, has_high_freq_coeff = 0;
- BLOCK_SIZE bsize = xd->mi[0].src_mi->mbmi.sb_type;
-
- if (bsize >= BLOCK_8X8) {
- int max_plane = is_inter_block(&xd->mi[0].src_mi->mbmi)
- ? MAX_MB_PLANE : 1;
- for (plane = 0; plane < max_plane; ++plane) {
- x->plane[plane].eobs = ctx->eobs_pbuf[plane][1];
- has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
- }
-
- for (plane = max_plane; plane < MAX_MB_PLANE; ++plane) {
- x->plane[plane].eobs = ctx->eobs_pbuf[plane][2];
- has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
- }
- }
// Take a snapshot of the coding context so it can be
// restored if we decide to encode this way
ctx->skip = x->skip;
- ctx->skippable = skippable || !has_high_freq_coeff;
+ ctx->skippable = skippable;
ctx->best_mode_index = mode_index;
ctx->mic = *xd->mi[0].src_mi;
ctx->single_pred_diff = (int)comp_pred_diff[SINGLE_REFERENCE];
@@ -3464,6 +3448,24 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// updating code causes PSNR loss. Need to figure out the confliction.
x->skip |= best_mode_skippable;
+ if (!best_mode_skippable && !x->select_tx_size) {
+ int has_high_freq_coeff = 0;
+ int plane;
+ int max_plane = is_inter_block(&xd->mi[0].src_mi->mbmi)
+ ? MAX_MB_PLANE : 1;
+ for (plane = 0; plane < max_plane; ++plane) {
+ x->plane[plane].eobs = ctx->eobs_pbuf[plane][1];
+ has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
+ }
+
+ for (plane = max_plane; plane < MAX_MB_PLANE; ++plane) {
+ x->plane[plane].eobs = ctx->eobs_pbuf[plane][2];
+ has_high_freq_coeff |= vp9_has_high_freq_in_plane(x, bsize, plane);
+ }
+
+ best_mode_skippable |= !has_high_freq_coeff;
+ }
+
store_coding_context(x, ctx, best_mode_index, best_pred_diff,
best_tx_diff, best_filter_diff, best_mode_skippable);