Merge "Skip computation of distortion in vp8_pick_inter_mode if active_map is used"
[libvpx.git] / vp8 / common / invtrans.c
blob81a3f2d890e4d5eebe66fd3e57460c0aa92323b9
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
12 #include "invtrans.h"
16 static void recon_dcblock(MACROBLOCKD *x)
18 BLOCKD *b = &x->block[24];
19 int i;
21 for (i = 0; i < 16; i++)
23 x->block[i].dqcoeff[0] = b->diff[i];
28 void vp8_inverse_transform_b(const vp8_idct_rtcd_vtable_t *rtcd, BLOCKD *b, int pitch)
30 if (b->eob > 1)
31 IDCT_INVOKE(rtcd, idct16)(b->dqcoeff, b->diff, pitch);
32 else
33 IDCT_INVOKE(rtcd, idct1)(b->dqcoeff, b->diff, pitch);
37 void vp8_inverse_transform_mby(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
39 int i;
41 /* do 2nd order transform on the dc block */
42 IDCT_INVOKE(rtcd, iwalsh16)(x->block[24].dqcoeff, x->block[24].diff);
44 recon_dcblock(x);
46 for (i = 0; i < 16; i++)
48 vp8_inverse_transform_b(rtcd, &x->block[i], 32);
52 void vp8_inverse_transform_mbuv(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
54 int i;
56 for (i = 16; i < 24; i++)
58 vp8_inverse_transform_b(rtcd, &x->block[i], 16);
64 void vp8_inverse_transform_mb(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
66 int i;
68 if (x->mode_info_context->mbmi.mode != B_PRED &&
69 x->mode_info_context->mbmi.mode != SPLITMV)
71 /* do 2nd order transform on the dc block */
73 IDCT_INVOKE(rtcd, iwalsh16)(&x->block[24].dqcoeff[0], x->block[24].diff);
74 recon_dcblock(x);
77 for (i = 0; i < 16; i++)
79 vp8_inverse_transform_b(rtcd, &x->block[i], 32);
83 for (i = 16; i < 24; i++)
85 vp8_inverse_transform_b(rtcd, &x->block[i], 16);