Commit e732bc29 authored by Scott LaVarnway's avatar Scott LaVarnway

Moved dequantization into the token decoder

Mostly for cleanup purposes.  Now we should be able to rework
the encoder/decoder to use a common idct/add function.

Change-Id: I1597cc59812f362ecec0a3493b6101a6cc6fa7ff
parent fbe9098c
......@@ -440,12 +440,11 @@ typedef struct macroblockd {
/* Inverse transform function pointers. */
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 *dest,
int stride, int eob);
void (*itxm_add_y_block)(int16_t *q, const int16_t *dq,
uint8_t *dst, int stride, struct macroblockd *xd);
void (*itxm_add_uv_block)(int16_t *q, const int16_t *dq,
uint8_t *dst, int stride, uint16_t *eobs);
void (*itxm_add)(int16_t *input, uint8_t *dest, int stride, int eob);
void (*itxm_add_y_block)(int16_t *q, uint8_t *dst, int stride,
struct macroblockd *xd);
void (*itxm_add_uv_block)(int16_t *q, uint8_t *dst, int stride,
uint16_t *eobs);
struct subpix_fn_table subpix;
......
......@@ -27,26 +27,26 @@ forward_decls vp9_common_forward_decls
#
# Dequant
#
prototype void vp9_dequant_idct_add_y_block_8x8 "int16_t *q, const int16_t *dq, uint8_t *dst, int stride, struct macroblockd *xd"
specialize vp9_dequant_idct_add_y_block_8x8
prototype void vp9_idct_add_y_block_8x8 "int16_t *q, uint8_t *dst, int stride, struct macroblockd *xd"
specialize vp9_idct_add_y_block_8x8
prototype void vp9_dequant_idct_add_16x16 "int16_t *input, const int16_t *dq, uint8_t *dest, int stride, int eob"
specialize vp9_dequant_idct_add_16x16
prototype void vp9_idct_add_16x16 "int16_t *input, uint8_t *dest, int stride, int eob"
specialize vp9_idct_add_16x16
prototype void vp9_dequant_idct_add_8x8 "int16_t *input, const int16_t *dq, uint8_t *dest, int stride, int eob"
specialize vp9_dequant_idct_add_8x8
prototype void vp9_idct_add_8x8 "int16_t *input, uint8_t *dest, int stride, int eob"
specialize vp9_idct_add_8x8
prototype void vp9_dequant_idct_add "int16_t *input, const int16_t *dq, uint8_t *dest, int stride, int eob"
specialize vp9_dequant_idct_add
prototype void vp9_idct_add "int16_t *input, uint8_t *dest, int stride, int eob"
specialize vp9_idct_add
prototype void vp9_dequant_idct_add_y_block "int16_t *q, const int16_t *dq, uint8_t *dst, int stride, struct macroblockd *xd"
specialize vp9_dequant_idct_add_y_block
prototype void vp9_idct_add_y_block "int16_t *q, uint8_t *dst, int stride, struct macroblockd *xd"
specialize vp9_idct_add_y_block
prototype void vp9_dequant_idct_add_uv_block "int16_t *q, const int16_t *dq, uint8_t *dst, int stride, uint16_t *eobs"
specialize vp9_dequant_idct_add_uv_block
prototype void vp9_idct_add_uv_block "int16_t *q, uint8_t *dst, int stride, uint16_t *eobs"
specialize vp9_idct_add_uv_block
prototype void vp9_dequant_idct_add_32x32 "int16_t *q, const int16_t *dq, uint8_t *dst, int stride, int eob"
specialize vp9_dequant_idct_add_32x32
prototype void vp9_idct_add_32x32 "int16_t *q, uint8_t *dst, int stride, int eob"
specialize vp9_idct_add_32x32
#
# RECON
......
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP9_DECODER_VP9_DEQUANTIZE_H_
#define VP9_DECODER_VP9_DEQUANTIZE_H_
#include "vp9/common/vp9_blockd.h"
void vp9_dequant_idct_add_lossless_c(int16_t *input, const int16_t *dq,
unsigned char *dest, int stride, int eob);
void vp9_dequant_dc_idct_add_lossless_c(int16_t *input, const int16_t *dq,
unsigned char *output, int stride,
int dc);
void vp9_dequant_dc_idct_add_y_block_lossless_c(int16_t *q,
const int16_t *dq,
unsigned char *pre,
unsigned char *dst,
int stride,
const int16_t *dc);
void vp9_dequant_idct_add_y_block_lossless_c(int16_t *q, const int16_t *dq,
unsigned char *dst, int stride,
struct macroblockd *xd);
void vp9_dequant_idct_add_uv_block_lossless_c(int16_t *q, const int16_t *dq,
unsigned char *dst,
int stride,
uint16_t *eobs);
void vp9_dequant_iht_add_c(TX_TYPE tx_type, int16_t *input, const int16_t *dq,
unsigned char *dest, int stride, int eob);
void vp9_dequant_iht_add_8x8_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq, unsigned char *dest,
int stride, int eob);
void vp9_dequant_iht_add_16x16_c(TX_TYPE tx_type, int16_t *input,
const int16_t *dq, unsigned char *dest,
int stride, int eob);
#endif // VP9_DECODER_VP9_DEQUANTIZE_H_
......@@ -81,7 +81,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
#else
#define WRITE_COEF_CONTINUE(val, token) \
{ \
qcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val); \
qcoeff_ptr[scan[c]] = vp9_read_and_apply_sign(r, val) * dq[c > 0]; \
INCREMENT_COUNT(token); \
c++; \
continue; \
......@@ -97,7 +97,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
vp9_reader *r, int block_idx,
PLANE_TYPE type, int seg_eob, int16_t *qcoeff_ptr,
TX_SIZE txfm_size) {
TX_SIZE txfm_size, const int16_t *dq) {
ENTROPY_CONTEXT* const A0 = (ENTROPY_CONTEXT *) xd->above_context;
ENTROPY_CONTEXT* const L0 = (ENTROPY_CONTEXT *) xd->left_context;
int aidx, lidx;
......@@ -400,6 +400,7 @@ struct decode_block_args {
MACROBLOCKD *xd;
vp9_reader *r;
int *eobtotal;
const int16_t *dq;
};
static void decode_block(int plane, int block,
BLOCK_SIZE_TYPE bsize,
......@@ -419,7 +420,7 @@ static void decode_block(int plane, int block,
const int eob = decode_coefs(arg->pbi, arg->xd, arg->r, old_block_idx,
arg->xd->plane[plane].plane_type, seg_eob,
BLOCK_OFFSET(qcoeff_base, block, 16),
ss_tx_size);
ss_tx_size, arg->dq);
arg->xd->plane[plane].eobs[block] = eob;
arg->eobtotal[0] += eob;
......@@ -428,9 +429,10 @@ static void decode_block(int plane, int block,
int vp9_decode_tokens(VP9D_COMP* const pbi,
MACROBLOCKD* const xd,
vp9_reader *r,
BLOCK_SIZE_TYPE bsize) {
BLOCK_SIZE_TYPE bsize,
const int16_t *dq) {
int eobtotal = 0;
struct decode_block_args args = {pbi, xd, r, &eobtotal};
struct decode_block_args args = {pbi, xd, r, &eobtotal, dq};
foreach_transformed_block(xd, bsize, decode_block, &args);
return eobtotal;
}
......@@ -438,10 +440,12 @@ int vp9_decode_tokens(VP9D_COMP* const pbi,
#if CONFIG_NEWBINTRAMODES
static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
vp9_reader *r,
PLANE_TYPE type, int i, int seg_eob) {
PLANE_TYPE type, int i, int seg_eob,
const int16_t *dq) {
const struct plane_block_idx pb_idx = plane_block_idx(16, i);
const int c = decode_coefs(dx, xd, r, i, type, seg_eob,
BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff, pb_idx.block, 16), TX_4X4);
BLOCK_OFFSET(xd->plane[pb_idx.plane].qcoeff, pb_idx.block, 16), TX_4X4,
dq);
xd->plane[pb_idx.plane].eobs[pb_idx.block] = c;
return c;
}
......@@ -449,30 +453,31 @@ static int decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
static int decode_mb_tokens_4x4_uv(VP9D_COMP* const dx,
MACROBLOCKD* const xd,
vp9_reader *r,
int seg_eob) {
int seg_eob,
const int16_t *dq) {
int i, eobtotal = 0;
// chroma blocks
for (i = 16; i < 24; i++)
eobtotal += decode_coefs_4x4(dx, xd, r, PLANE_TYPE_UV, i, seg_eob);
eobtotal += decode_coefs_4x4(dx, xd, r, PLANE_TYPE_UV, i, seg_eob, dq);
return eobtotal;
}
int vp9_decode_mb_tokens_4x4_uv(VP9D_COMP* const dx,
MACROBLOCKD* const xd,
vp9_reader *r) {
vp9_reader *r, const int16_t *dq) {
const int segment_id = xd->mode_info_context->mbmi.segment_id;
const int seg_eob = get_eob(xd, segment_id, 16);
return decode_mb_tokens_4x4_uv(dx, xd, r, seg_eob);
return decode_mb_tokens_4x4_uv(dx, xd, r, seg_eob, dq);
}
int vp9_decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
vp9_reader *r,
PLANE_TYPE type, int i) {
PLANE_TYPE type, int i, const int16_t *dq) {
const int segment_id = xd->mode_info_context->mbmi.segment_id;
const int seg_eob = get_eob(xd, segment_id, 16);
return decode_coefs_4x4(dx, xd, r, type, i, seg_eob);
return decode_coefs_4x4(dx, xd, r, type, i, seg_eob, dq);
}
#endif
......@@ -17,14 +17,15 @@
int vp9_decode_tokens(VP9D_COMP* const pbi,
MACROBLOCKD* const xd,
vp9_reader *r,
BLOCK_SIZE_TYPE bsize);
BLOCK_SIZE_TYPE bsize,
const int16_t *dq);
int vp9_decode_mb_tokens_4x4_uv(VP9D_COMP* const dx, MACROBLOCKD* const xd,
vp9_reader *r);
#if CONFIG_NEWBINTRAMODES
int vp9_decode_mb_tokens_4x4_uv(VP9D_COMP* const dx, MACROBLOCKD* const xd,
vp9_reader *r, const int16_t *dq);
int vp9_decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
vp9_reader *r,
PLANE_TYPE type, int i);
PLANE_TYPE type, int i, const int16_t *dq);
#endif
#endif // VP9_DECODER_VP9_DETOKENIZE_H_
This diff is collapsed.
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP9_DECODER_VP9_IDCT_BLK_H_
#define VP9_DECODER_VP9_IDCT_BLK_H_
#include "vp9/common/vp9_blockd.h"
void vp9_idct_add_lossless_c(int16_t *input, unsigned char *dest, int stride,
int eob);
void vp9_dc_idct_add_lossless_c(int16_t *input, unsigned char *output,
int stride, int dc);
void vp9_dc_idct_add_y_block_lossless_c(int16_t *q, unsigned char *pre,
unsigned char *dst, int stride,
const int16_t *dc);
void vp9_idct_add_y_block_lossless_c(int16_t *q, unsigned char *dst, int stride,
struct macroblockd *xd);
void vp9_idct_add_uv_block_lossless_c(int16_t *q, unsigned char *dst,
int stride, uint16_t *eobs);
void vp9_iht_add_c(TX_TYPE tx_type, int16_t *input, unsigned char *dest,
int stride, int eob);
void vp9_iht_add_8x8_c(TX_TYPE tx_type, int16_t *input, unsigned char *dest,
int stride, int eob);
void vp9_iht_add_16x16_c(TX_TYPE tx_type, int16_t *input, unsigned char *dest,
int stride, int eob);
#endif // VP9_DECODER_VP9_IDCT_BLK_H_
......@@ -14,7 +14,7 @@
#include "vp9/decoder/vp9_onyxd.h"
#include "vp9/decoder/vp9_treereader.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/decoder/vp9_dequantize.h"
#include "vp9/decoder/vp9_idct_blk.h"
// #define DEC_DEBUG
......
......@@ -10,7 +10,6 @@
#include "./vpx_config.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/decoder/vp9_dequantize.h"
void vp9_idct_dequant_dc_0_2x_sse2(short *q, const short *dq,
unsigned char *pre, unsigned char *dst,
......
......@@ -22,17 +22,16 @@ VP9_DX_SRCS-yes += decoder/vp9_dboolhuff.c
VP9_DX_SRCS-yes += decoder/vp9_decodemv.c
VP9_DX_SRCS-yes += decoder/vp9_decodframe.c
VP9_DX_SRCS-yes += decoder/vp9_decodframe.h
VP9_DX_SRCS-yes += decoder/vp9_dequantize.c
VP9_DX_SRCS-yes += decoder/vp9_detokenize.c
VP9_DX_SRCS-yes += decoder/vp9_dboolhuff.h
VP9_DX_SRCS-yes += decoder/vp9_decodemv.h
VP9_DX_SRCS-yes += decoder/vp9_dequantize.h
VP9_DX_SRCS-yes += decoder/vp9_detokenize.h
VP9_DX_SRCS-yes += decoder/vp9_onyxd.h
VP9_DX_SRCS-yes += decoder/vp9_onyxd_int.h
VP9_DX_SRCS-yes += decoder/vp9_treereader.h
VP9_DX_SRCS-yes += decoder/vp9_onyxd_if.c
VP9_DX_SRCS-yes += decoder/vp9_idct_blk.c
VP9_DX_SRCS-yes += decoder/vp9_idct_blk.h
VP9_DX_SRCS-yes := $(filter-out $(VP9_DX_SRCS_REMOVE-yes),$(VP9_DX_SRCS-yes))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment