Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: source/libvpx/vp9/common/vp9_idct.h

Issue 668403002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_filter.h ('k') | source/libvpx/vp9/common/vp9_idct.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_idct.h
===================================================================
--- source/libvpx/vp9/common/vp9_idct.h (revision 292608)
+++ source/libvpx/vp9/common/vp9_idct.h (working copy)
@@ -14,7 +14,6 @@
#include <assert.h>
#include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_enums.h"
@@ -22,7 +21,6 @@
extern "C" {
#endif
-
// Constants and Macros used by all idct/dct functions
#define DCT_CONST_BITS 14
#define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1))
@@ -36,17 +34,6 @@
#define dual_set_epi16(a, b) \
_mm_set_epi16(b, b, b, b, a, a, a, a)
-// Note:
-// tran_low_t is the datatype used for final transform coefficients.
-// tran_high_t is the datatype used for intermediate transform stages.
-#if CONFIG_VP9_HIGHBITDEPTH
-typedef int64_t tran_high_t;
-typedef int32_t tran_low_t;
-#else
-typedef int32_t tran_high_t;
-typedef int16_t tran_low_t;
-#endif
-
// Constants:
// for (int i = 1; i< 32; ++i)
// printf("static const int cospi_%d_64 = %.0f;\n", i,
@@ -90,8 +77,7 @@
static const tran_high_t sinpi_3_9 = 13377;
static const tran_high_t sinpi_4_9 = 15212;
-static INLINE tran_low_t dct_const_round_shift(tran_high_t input) {
- tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
+static INLINE tran_low_t check_range(tran_high_t input) {
#if CONFIG_VP9_HIGHBITDEPTH
// For valid highbitdepth VP9 streams, intermediate stage coefficients will
// stay within the ranges:
@@ -105,12 +91,17 @@
// this range for every intermediate coefficient can burdensome for a decoder,
// therefore the following assertion is only enabled when configured with
// --enable-coefficient-range-checking.
- assert(INT16_MIN <= rv);
- assert(rv <= INT16_MAX);
+ assert(INT16_MIN <= input);
+ assert(input <= INT16_MAX);
#endif
- return (tran_low_t)rv;
+ return (tran_low_t)input;
}
+static INLINE tran_low_t dct_const_round_shift(tran_high_t input) {
+ tran_high_t rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
+ return check_range(rv);
+}
+
typedef void (*transform_1d)(const tran_low_t*, tran_low_t*);
typedef struct {
@@ -118,11 +109,11 @@
} transform_2d;
#if CONFIG_VP9_HIGHBITDEPTH
-typedef void (*high_transform_1d)(const tran_low_t*, tran_low_t*, int bd);
+typedef void (*highbd_transform_1d)(const tran_low_t*, tran_low_t*, int bd);
typedef struct {
- high_transform_1d cols, rows; // vertical and horizontal
-} high_transform_2d;
+ highbd_transform_1d cols, rows; // vertical and horizontal
+} highbd_transform_2d;
#endif // CONFIG_VP9_HIGHBITDEPTH
void vp9_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
@@ -144,22 +135,22 @@
int stride, int eob);
#if CONFIG_VP9_HIGHBITDEPTH
-void vp9_high_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
- int eob, int bd);
-void vp9_high_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
- int eob, int bd);
-void vp9_high_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
- int eob, int bd);
-void vp9_high_idct16x16_add(const tran_low_t *input, uint8_t *dest, int stride,
+void vp9_highbd_iwht4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob, int bd);
-void vp9_high_idct32x32_add(const tran_low_t *input, uint8_t *dest, int stride,
+void vp9_highbd_idct4x4_add(const tran_low_t *input, uint8_t *dest, int stride,
int eob, int bd);
-void vp9_high_iht4x4_add(TX_TYPE tx_type, const tran_low_t *input,
- uint8_t *dest, int stride, int eob, int bd);
-void vp9_high_iht8x8_add(TX_TYPE tx_type, const tran_low_t *input,
- uint8_t *dest, int stride, int eob, int bd);
-void vp9_high_iht16x16_add(TX_TYPE tx_type, const tran_low_t *input,
+void vp9_highbd_idct8x8_add(const tran_low_t *input, uint8_t *dest, int stride,
+ int eob, int bd);
+void vp9_highbd_idct16x16_add(const tran_low_t *input, uint8_t *dest,
+ int stride, int eob, int bd);
+void vp9_highbd_idct32x32_add(const tran_low_t *input, uint8_t *dest,
+ int stride, int eob, int bd);
+void vp9_highbd_iht4x4_add(TX_TYPE tx_type, const tran_low_t *input,
uint8_t *dest, int stride, int eob, int bd);
+void vp9_highbd_iht8x8_add(TX_TYPE tx_type, const tran_low_t *input,
+ uint8_t *dest, int stride, int eob, int bd);
+void vp9_highbd_iht16x16_add(TX_TYPE tx_type, const tran_low_t *input,
+ uint8_t *dest, int stride, int eob, int bd);
#endif // CONFIG_VP9_HIGHBITDEPTH
#ifdef __cplusplus
} // extern "C"
« no previous file with comments | « source/libvpx/vp9/common/vp9_filter.h ('k') | source/libvpx/vp9/common/vp9_idct.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698