OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 for (i = 1; i < MAX_MB_PLANE; i++) | 188 for (i = 1; i < MAX_MB_PLANE; i++) |
189 xd->plane[i].dequant = cm->uv_dequant[q_index]; | 189 xd->plane[i].dequant = cm->uv_dequant[q_index]; |
190 } | 190 } |
191 | 191 |
192 static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block, | 192 static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block, |
193 TX_SIZE tx_size, uint8_t *dst, int stride, | 193 TX_SIZE tx_size, uint8_t *dst, int stride, |
194 int eob) { | 194 int eob) { |
195 struct macroblockd_plane *const pd = &xd->plane[plane]; | 195 struct macroblockd_plane *const pd = &xd->plane[plane]; |
196 if (eob > 0) { | 196 if (eob > 0) { |
197 TX_TYPE tx_type; | 197 TX_TYPE tx_type = DCT_DCT; |
198 int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); | 198 int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block); |
199 if (xd->lossless) { | 199 if (xd->lossless) { |
200 tx_type = DCT_DCT; | 200 tx_type = DCT_DCT; |
201 vp9_iwht4x4_add(dqcoeff, dst, stride, eob); | 201 vp9_iwht4x4_add(dqcoeff, dst, stride, eob); |
202 } else { | 202 } else { |
203 const PLANE_TYPE plane_type = pd->plane_type; | 203 const PLANE_TYPE plane_type = pd->plane_type; |
204 switch (tx_size) { | 204 switch (tx_size) { |
205 case TX_4X4: | 205 case TX_4X4: |
206 tx_type = get_tx_type_4x4(plane_type, xd, block); | 206 tx_type = get_tx_type_4x4(plane_type, xd, block); |
207 vp9_iht4x4_add(tx_type, dqcoeff, dst, stride, eob); | 207 vp9_iht4x4_add(tx_type, dqcoeff, dst, stride, eob); |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, | 1127 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, |
1128 "Invalid frame sync code"); | 1128 "Invalid frame sync code"); |
1129 if (cm->profile > PROFILE_1) | 1129 if (cm->profile > PROFILE_1) |
1130 cm->bit_depth = vp9_rb_read_bit(rb) ? BITS_12 : BITS_10; | 1130 cm->bit_depth = vp9_rb_read_bit(rb) ? BITS_12 : BITS_10; |
1131 cm->color_space = (COLOR_SPACE)vp9_rb_read_literal(rb, 3); | 1131 cm->color_space = (COLOR_SPACE)vp9_rb_read_literal(rb, 3); |
1132 if (cm->color_space != SRGB) { | 1132 if (cm->color_space != SRGB) { |
1133 vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range | 1133 vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range |
1134 if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { | 1134 if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { |
1135 cm->subsampling_x = vp9_rb_read_bit(rb); | 1135 cm->subsampling_x = vp9_rb_read_bit(rb); |
1136 cm->subsampling_y = vp9_rb_read_bit(rb); | 1136 cm->subsampling_y = vp9_rb_read_bit(rb); |
1137 vp9_rb_read_bit(rb); // has extra plane | 1137 if (vp9_rb_read_bit(rb)) |
| 1138 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, |
| 1139 "Reserved bit set"); |
1138 } else { | 1140 } else { |
1139 cm->subsampling_y = cm->subsampling_x = 1; | 1141 cm->subsampling_y = cm->subsampling_x = 1; |
1140 } | 1142 } |
1141 } else { | 1143 } else { |
1142 if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { | 1144 if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { |
1143 cm->subsampling_y = cm->subsampling_x = 0; | 1145 cm->subsampling_y = cm->subsampling_x = 0; |
1144 vp9_rb_read_bit(rb); // has extra plane | 1146 if (vp9_rb_read_bit(rb)) |
| 1147 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, |
| 1148 "Reserved bit set"); |
1145 } else { | 1149 } else { |
1146 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, | 1150 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, |
1147 "4:4:4 color not supported in profile 0"); | 1151 "4:4:4 color not supported in profile 0"); |
1148 } | 1152 } |
1149 } | 1153 } |
1150 | 1154 |
1151 pbi->refresh_frame_flags = (1 << REF_FRAMES) - 1; | 1155 pbi->refresh_frame_flags = (1 << REF_FRAMES) - 1; |
1152 | 1156 |
1153 for (i = 0; i < REFS_PER_FRAME; ++i) { | 1157 for (i = 0; i < REFS_PER_FRAME; ++i) { |
1154 cm->frame_refs[i].idx = -1; | 1158 cm->frame_refs[i].idx = -1; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 debug_check_frame_counts(cm); | 1430 debug_check_frame_counts(cm); |
1427 } | 1431 } |
1428 } else { | 1432 } else { |
1429 vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, | 1433 vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, |
1430 "Decode failed. Frame data is corrupted."); | 1434 "Decode failed. Frame data is corrupted."); |
1431 } | 1435 } |
1432 | 1436 |
1433 if (cm->refresh_frame_context) | 1437 if (cm->refresh_frame_context) |
1434 cm->frame_contexts[cm->frame_context_idx] = cm->fc; | 1438 cm->frame_contexts[cm->frame_context_idx] = cm->fc; |
1435 } | 1439 } |
OLD | NEW |