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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 for (i = 0; i < 8; ++i) { | 414 for (i = 0; i < 8; ++i) { |
415 for (j = 0; j < 8; ++j) | 415 for (j = 0; j < 8; ++j) |
416 temp_in[j] = out[j * 8 + i]; | 416 temp_in[j] = out[j * 8 + i]; |
417 ht.cols(temp_in, temp_out); | 417 ht.cols(temp_in, temp_out); |
418 for (j = 0; j < 8; ++j) | 418 for (j = 0; j < 8; ++j) |
419 dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) | 419 dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5) |
420 + dest[j * stride + i]); | 420 + dest[j * stride + i]); |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 void vp9_idct8x8_10_add_c(const int16_t *input, uint8_t *dest, int stride) { | 424 void vp9_idct8x8_12_add_c(const int16_t *input, uint8_t *dest, int stride) { |
425 int16_t out[8 * 8] = { 0 }; | 425 int16_t out[8 * 8] = { 0 }; |
426 int16_t *outptr = out; | 426 int16_t *outptr = out; |
427 int i, j; | 427 int i, j; |
428 int16_t temp_in[8], temp_out[8]; | 428 int16_t temp_in[8], temp_out[8]; |
429 | 429 |
430 // First transform rows | 430 // First transform rows |
431 // only first 4 row has non-zero coefs | 431 // only first 4 row has non-zero coefs |
432 for (i = 0; i < 4; ++i) { | 432 for (i = 0; i < 4; ++i) { |
433 idct8(input, outptr); | 433 idct8(input, outptr); |
434 input += 8; | 434 input += 8; |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 // If dc is 1, then input[0] is the reconstructed value, do not need | 1341 // If dc is 1, then input[0] is the reconstructed value, do not need |
1342 // dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1. | 1342 // dequantization. Also, when dc is 1, dc is counted in eobs, namely eobs >=1. |
1343 | 1343 |
1344 // The calculation can be simplified if there are not many non-zero dct | 1344 // The calculation can be simplified if there are not many non-zero dct |
1345 // coefficients. Use eobs to decide what to do. | 1345 // coefficients. Use eobs to decide what to do. |
1346 // TODO(yunqingwang): "eobs = 1" case is also handled in vp9_short_idct8x8_c. | 1346 // TODO(yunqingwang): "eobs = 1" case is also handled in vp9_short_idct8x8_c. |
1347 // Combine that with code here. | 1347 // Combine that with code here. |
1348 if (eob == 1) | 1348 if (eob == 1) |
1349 // DC only DCT coefficient | 1349 // DC only DCT coefficient |
1350 vp9_idct8x8_1_add(input, dest, stride); | 1350 vp9_idct8x8_1_add(input, dest, stride); |
1351 else if (eob <= 10) | 1351 else if (eob <= 12) |
1352 vp9_idct8x8_10_add(input, dest, stride); | 1352 vp9_idct8x8_12_add(input, dest, stride); |
1353 else | 1353 else |
1354 vp9_idct8x8_64_add(input, dest, stride); | 1354 vp9_idct8x8_64_add(input, dest, stride); |
1355 } | 1355 } |
1356 | 1356 |
1357 void vp9_idct16x16_add(const int16_t *input, uint8_t *dest, int stride, | 1357 void vp9_idct16x16_add(const int16_t *input, uint8_t *dest, int stride, |
1358 int eob) { | 1358 int eob) { |
1359 /* The calculation can be simplified if there are not many non-zero dct | 1359 /* The calculation can be simplified if there are not many non-zero dct |
1360 * coefficients. Use eobs to separate different cases. */ | 1360 * coefficients. Use eobs to separate different cases. */ |
1361 if (eob == 1) | 1361 if (eob == 1) |
1362 /* DC only DCT coefficient. */ | 1362 /* DC only DCT coefficient. */ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 } | 1397 } |
1398 | 1398 |
1399 void vp9_iht16x16_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest, | 1399 void vp9_iht16x16_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest, |
1400 int stride, int eob) { | 1400 int stride, int eob) { |
1401 if (tx_type == DCT_DCT) { | 1401 if (tx_type == DCT_DCT) { |
1402 vp9_idct16x16_add(input, dest, stride, eob); | 1402 vp9_idct16x16_add(input, dest, stride, eob); |
1403 } else { | 1403 } else { |
1404 vp9_iht16x16_256_add(input, dest, stride, tx_type); | 1404 vp9_iht16x16_256_add(input, dest, stride, tx_type); |
1405 } | 1405 } |
1406 } | 1406 } |
OLD | NEW |