summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_blockd.h
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/common/vp9_blockd.h')
-rw-r--r--vp9/common/vp9_blockd.h80
1 files changed, 31 insertions, 49 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index b84da812e..fb9cdfe2e 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -47,27 +47,13 @@ void vpx_log(const char *format, ...);
#define MAX_MV_REFS 9
#define MAX_MV_REF_CANDIDATES 4
-#if CONFIG_DWTDCTHYBRID
-#define DWT_MAX_LENGTH 64
-#define DWT_TYPE 26 // 26/53/97
-#define DWT_PRECISION_BITS 2
-#define DWT_PRECISION_RND ((1 << DWT_PRECISION_BITS) / 2)
-
-#define DWTDCT16X16 0
-#define DWTDCT16X16_LEAN 1
-#define DWTDCT8X8 2
-#define DWTDCT_TYPE DWTDCT16X16_LEAN
-#endif
-
typedef struct {
int r, c;
} POS;
-typedef enum PlaneType {
- PLANE_TYPE_Y_NO_DC = 0,
- PLANE_TYPE_Y2,
- PLANE_TYPE_UV,
+typedef enum {
PLANE_TYPE_Y_WITH_DC,
+ PLANE_TYPE_UV,
} PLANE_TYPE;
typedef char ENTROPY_CONTEXT;
@@ -75,10 +61,9 @@ typedef struct {
ENTROPY_CONTEXT y1[4];
ENTROPY_CONTEXT u[2];
ENTROPY_CONTEXT v[2];
- ENTROPY_CONTEXT y2;
} ENTROPY_CONTEXT_PLANES;
-#define VP9_COMBINEENTROPYCONTEXTS( Dest, A, B) \
+#define VP9_COMBINEENTROPYCONTEXTS(Dest, A, B) \
Dest = ((A)!=0) + ((B)!=0);
typedef enum {
@@ -154,10 +139,7 @@ typedef enum {
#define VP9_MVREFS (1 + SPLITMV - NEARESTMV)
-#if CONFIG_LOSSLESS
-#define WHT_UPSCALE_FACTOR 3
-#define Y2_WHT_UPSCALE_FACTOR 2
-#endif
+#define WHT_UPSCALE_FACTOR 2
typedef enum {
B_DC_PRED, /* average of above and left pixels */
@@ -300,23 +282,23 @@ typedef struct blockd {
} BLOCKD;
typedef struct superblockd {
- /* 32x32 Y and 16x16 U/V. No 2nd order transform yet. */
+ /* 32x32 Y and 16x16 U/V */
DECLARE_ALIGNED(16, int16_t, diff[32*32+16*16*2]);
DECLARE_ALIGNED(16, int16_t, qcoeff[32*32+16*16*2]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[32*32+16*16*2]);
} SUPERBLOCKD;
typedef struct macroblockd {
- DECLARE_ALIGNED(16, int16_t, diff[400]); /* from idct diff */
+ DECLARE_ALIGNED(16, int16_t, diff[384]); /* from idct diff */
DECLARE_ALIGNED(16, uint8_t, predictor[384]);
- DECLARE_ALIGNED(16, int16_t, qcoeff[400]);
- DECLARE_ALIGNED(16, int16_t, dqcoeff[400]);
- DECLARE_ALIGNED(16, uint16_t, eobs[25]);
+ DECLARE_ALIGNED(16, int16_t, qcoeff[384]);
+ DECLARE_ALIGNED(16, int16_t, dqcoeff[384]);
+ DECLARE_ALIGNED(16, uint16_t, eobs[24]);
SUPERBLOCKD sb_coeff_data;
- /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */
- BLOCKD block[25];
+ /* 16 Y blocks, 4 U, 4 V, each with 16 entries. */
+ BLOCKD block[24];
int fullpixel_mask;
YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */
@@ -333,7 +315,7 @@ typedef struct macroblockd {
int left_available;
int right_available;
- /* Y,U,V,Y2 */
+ /* Y,U,V */
ENTROPY_CONTEXT_PLANES *above_context;
ENTROPY_CONTEXT_PLANES *left_context;
@@ -383,11 +365,19 @@ typedef struct macroblockd {
unsigned int frames_since_golden;
unsigned int frames_till_alt_ref_frame;
+ int lossless;
/* Inverse transform function pointers. */
- void (*inv_xform4x4_1_x8)(int16_t *input, int16_t *output, int pitch);
- void (*inv_xform4x4_x8)(int16_t *input, int16_t *output, int pitch);
- void (*inv_walsh4x4_1)(int16_t *in, int16_t *out);
- void (*inv_walsh4x4_lossless)(int16_t *in, int16_t *out);
+ void (*inv_txm4x4_1)(int16_t *input, int16_t *output, int pitch);
+ void (*inv_txm4x4)(int16_t *input, int16_t *output, int pitch);
+ void (*itxm_add)(int16_t *input, const int16_t *dq,
+ uint8_t *pred, uint8_t *output, int pitch, int stride);
+ void (*dc_only_itxm_add)(int input_dc, uint8_t *pred_ptr,
+ uint8_t *dst_ptr, int pitch, int stride);
+ void (*itxm_add_y_block)(int16_t *q, const int16_t *dq,
+ uint8_t *pre, uint8_t *dst, int stride, uint16_t *eobs);
+ void (*itxm_add_uv_block)(int16_t *q, const int16_t *dq,
+ uint8_t *pre, uint8_t *dst_u, uint8_t *dst_v, int stride,
+ uint16_t *eobs);
struct subpix_fn_table subpix;
@@ -405,7 +395,7 @@ typedef struct macroblockd {
#define ACTIVE_HT8 300
-#define ACTIVE_HT16 0
+#define ACTIVE_HT16 300
// convert MB_PREDICTION_MODE to B_PREDICTION_MODE
static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
@@ -483,8 +473,8 @@ static TX_TYPE txfm_map(B_PREDICTION_MODE bmode) {
return tx_type;
}
-extern const uint8_t vp9_block2left[TX_SIZE_MAX_SB][25];
-extern const uint8_t vp9_block2above[TX_SIZE_MAX_SB][25];
+extern const uint8_t vp9_block2left[TX_SIZE_MAX_SB][24];
+extern const uint8_t vp9_block2above[TX_SIZE_MAX_SB][24];
#define USE_ADST_FOR_I16X16_8X8 0
#define USE_ADST_FOR_I16X16_4X4 0
@@ -498,6 +488,8 @@ static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, const BLOCKD *b) {
int ib = (int)(b - xd->block);
if (ib >= 16)
return tx_type;
+ if (xd->lossless)
+ return DCT_DCT;
// TODO(rbultje, debargha): Explore ADST usage for superblocks
if (xd->mode_info_context->mbmi.sb_type)
return tx_type;
@@ -614,18 +606,8 @@ static TX_TYPE get_tx_type(const MACROBLOCKD *xd, const BLOCKD *b) {
return tx_type;
}
-static int get_2nd_order_usage(const MACROBLOCKD *xd) {
- int has_2nd_order = (xd->mode_info_context->mbmi.mode != SPLITMV &&
- xd->mode_info_context->mbmi.mode != I8X8_PRED &&
- xd->mode_info_context->mbmi.mode != B_PRED &&
- xd->mode_info_context->mbmi.txfm_size != TX_16X16);
- if (has_2nd_order)
- has_2nd_order = (get_tx_type(xd, xd->block) == DCT_DCT);
- return has_2nd_order;
-}
-
-extern void vp9_build_block_doffsets(MACROBLOCKD *xd);
-extern void vp9_setup_block_dptrs(MACROBLOCKD *xd);
+void vp9_build_block_doffsets(MACROBLOCKD *xd);
+void vp9_setup_block_dptrs(MACROBLOCKD *xd);
static void update_blockd_bmi(MACROBLOCKD *xd) {
int i;