John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
John Koleszar | c2140b8 | 2010-09-09 08:16:39 -0400 | [diff] [blame] | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 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 |
John Koleszar | 94c52e4 | 2010-06-18 12:39:21 -0400 | [diff] [blame] | 7 | * in the file PATENTS. All contributing project authors may |
John Koleszar | 09202d8 | 2010-06-04 16:19:40 -0400 | [diff] [blame] | 8 | * be found in the AUTHORS file in the root of the source tree. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | |
| 12 | #include "invtrans.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | static void recon_dcblock(MACROBLOCKD *x) |
| 17 | { |
| 18 | BLOCKD *b = &x->block[24]; |
| 19 | int i; |
| 20 | |
| 21 | for (i = 0; i < 16; i++) |
| 22 | { |
| 23 | x->block[i].dqcoeff[0] = b->diff[i]; |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |
| 28 | void vp8_inverse_transform_b(const vp8_idct_rtcd_vtable_t *rtcd, BLOCKD *b, int pitch) |
| 29 | { |
| 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); |
| 34 | } |
| 35 | |
| 36 | |
| 37 | void vp8_inverse_transform_mby(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) |
| 38 | { |
| 39 | int i; |
| 40 | |
Timothy B. Terriberry | c4d7e5e | 2010-10-27 16:04:02 -0700 | [diff] [blame] | 41 | /* do 2nd order transform on the dc block */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 42 | IDCT_INVOKE(rtcd, iwalsh16)(x->block[24].dqcoeff, x->block[24].diff); |
| 43 | |
| 44 | recon_dcblock(x); |
| 45 | |
| 46 | for (i = 0; i < 16; i++) |
| 47 | { |
| 48 | vp8_inverse_transform_b(rtcd, &x->block[i], 32); |
| 49 | } |
| 50 | |
| 51 | } |
| 52 | void vp8_inverse_transform_mbuv(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) |
| 53 | { |
| 54 | int i; |
| 55 | |
| 56 | for (i = 16; i < 24; i++) |
| 57 | { |
| 58 | vp8_inverse_transform_b(rtcd, &x->block[i], 16); |
| 59 | } |
| 60 | |
| 61 | } |
| 62 | |
| 63 | |
| 64 | void vp8_inverse_transform_mb(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) |
| 65 | { |
| 66 | int i; |
| 67 | |
Scott LaVarnway | 9c7a009 | 2010-08-12 16:25:43 -0400 | [diff] [blame] | 68 | if (x->mode_info_context->mbmi.mode != B_PRED && |
| 69 | x->mode_info_context->mbmi.mode != SPLITMV) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 70 | { |
Timothy B. Terriberry | c4d7e5e | 2010-10-27 16:04:02 -0700 | [diff] [blame] | 71 | /* do 2nd order transform on the dc block */ |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 72 | |
| 73 | IDCT_INVOKE(rtcd, iwalsh16)(&x->block[24].dqcoeff[0], x->block[24].diff); |
| 74 | recon_dcblock(x); |
| 75 | } |
| 76 | |
| 77 | for (i = 0; i < 16; i++) |
| 78 | { |
| 79 | vp8_inverse_transform_b(rtcd, &x->block[i], 32); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | for (i = 16; i < 24; i++) |
| 84 | { |
| 85 | vp8_inverse_transform_b(rtcd, &x->block[i], 16); |
| 86 | } |
| 87 | |
| 88 | } |