123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- #ifndef VPX_DSP_INV_TXFM_H_
- #define VPX_DSP_INV_TXFM_H_
- #include <assert.h>
- #include "./vpx_config.h"
- #include "vpx_dsp/txfm_common.h"
- #include "vpx_ports/mem.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- static INLINE tran_high_t check_range(tran_high_t input) {
- #if CONFIG_COEFFICIENT_RANGE_CHECKING
-
-
-
-
-
-
- assert(INT16_MIN <= input);
- assert(input <= INT16_MAX);
- #endif
- return input;
- }
- static INLINE tran_high_t dct_const_round_shift(tran_high_t input) {
- tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
- return (tran_high_t)rv;
- }
- #if CONFIG_VP9_HIGHBITDEPTH
- static INLINE tran_high_t highbd_check_range(tran_high_t input,
- int bd) {
- #if CONFIG_COEFFICIENT_RANGE_CHECKING
-
-
-
-
-
- const int32_t int_max = (1 << (7 + bd)) - 1;
- const int32_t int_min = -int_max - 1;
- assert(int_min <= input);
- assert(input <= int_max);
- (void) int_min;
- #endif
- (void) bd;
- return input;
- }
- static INLINE tran_high_t highbd_dct_const_round_shift(tran_high_t input) {
- tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
- return (tran_high_t)rv;
- }
- #endif
- #if CONFIG_EMULATE_HARDWARE
- #define WRAPLOW(x) ((((int32_t)check_range(x)) << 16) >> 16)
- #if CONFIG_VP9_HIGHBITDEPTH
- #define HIGHBD_WRAPLOW(x, bd) \
- ((((int32_t)highbd_check_range((x), bd)) << (24 - bd)) >> (24 - bd))
- #endif
- #else
- #define WRAPLOW(x) ((int32_t)check_range(x))
- #if CONFIG_VP9_HIGHBITDEPTH
- #define HIGHBD_WRAPLOW(x, bd) \
- ((int32_t)highbd_check_range((x), bd))
- #endif
- #endif
- void idct4_c(const tran_low_t *input, tran_low_t *output);
- void idct8_c(const tran_low_t *input, tran_low_t *output);
- void idct16_c(const tran_low_t *input, tran_low_t *output);
- void idct32_c(const tran_low_t *input, tran_low_t *output);
- void iadst4_c(const tran_low_t *input, tran_low_t *output);
- void iadst8_c(const tran_low_t *input, tran_low_t *output);
- void iadst16_c(const tran_low_t *input, tran_low_t *output);
- #if CONFIG_VP9_HIGHBITDEPTH
- void vpx_highbd_idct4_c(const tran_low_t *input, tran_low_t *output, int bd);
- void vpx_highbd_idct8_c(const tran_low_t *input, tran_low_t *output, int bd);
- void vpx_highbd_idct16_c(const tran_low_t *input, tran_low_t *output, int bd);
- void vpx_highbd_iadst4_c(const tran_low_t *input, tran_low_t *output, int bd);
- void vpx_highbd_iadst8_c(const tran_low_t *input, tran_low_t *output, int bd);
- void vpx_highbd_iadst16_c(const tran_low_t *input, tran_low_t *output, int bd);
- static INLINE uint16_t highbd_clip_pixel_add(uint16_t dest, tran_high_t trans,
- int bd) {
- trans = HIGHBD_WRAPLOW(trans, bd);
- return clip_pixel_highbd(dest + (int)trans, bd);
- }
- #endif
- static INLINE uint8_t clip_pixel_add(uint8_t dest, tran_high_t trans) {
- trans = WRAPLOW(trans);
- return clip_pixel(dest + (int)trans);
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
|