Commit ae2f732e authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Adding fht{4x4, 8x8, 16x16} functions.

Adding these functions to encapsulate tx_type check. Changing TX_TYPE to
int to match the declaration in vo9_rtch.h.

Change-Id: I6f3a2df6e35595ca73b6aaa9e3909ee7bc3fd16f
Showing with 60 additions and 13 deletions
...@@ -8,14 +8,17 @@ ...@@ -8,14 +8,17 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include "./vpx_config.h" #include "./vpx_config.h"
#include "vp9/common/vp9_systemdependent.h" #include "./vp9_rtcd.h"
#include "vp9/common/vp9_blockd.h" #include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_idct.h" #include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/encoder/vp9_dct.h"
static void fdct4(const int16_t *input, int16_t *output) { static void fdct4(const int16_t *input, int16_t *output) {
int16_t step[4]; int16_t step[4];
...@@ -149,7 +152,7 @@ static const transform_2d FHT_4[] = { ...@@ -149,7 +152,7 @@ static const transform_2d FHT_4[] = {
}; };
void vp9_short_fht4x4_c(const int16_t *input, int16_t *output, void vp9_short_fht4x4_c(const int16_t *input, int16_t *output,
int stride, TX_TYPE tx_type) { int stride, int tx_type) {
int16_t out[4 * 4]; int16_t out[4 * 4];
int16_t *outptr = &out[0]; int16_t *outptr = &out[0];
int i, j; int i, j;
...@@ -557,7 +560,7 @@ static const transform_2d FHT_8[] = { ...@@ -557,7 +560,7 @@ static const transform_2d FHT_8[] = {
}; };
void vp9_short_fht8x8_c(const int16_t *input, int16_t *output, void vp9_short_fht8x8_c(const int16_t *input, int16_t *output,
int stride, TX_TYPE tx_type) { int stride, int tx_type) {
int16_t out[64]; int16_t out[64];
int16_t *outptr = &out[0]; int16_t *outptr = &out[0];
int i, j; int i, j;
...@@ -950,7 +953,7 @@ static const transform_2d FHT_16[] = { ...@@ -950,7 +953,7 @@ static const transform_2d FHT_16[] = {
}; };
void vp9_short_fht16x16_c(const int16_t *input, int16_t *output, void vp9_short_fht16x16_c(const int16_t *input, int16_t *output,
int stride, TX_TYPE tx_type) { int stride, int tx_type) {
int16_t out[256]; int16_t out[256];
int16_t *outptr = &out[0]; int16_t *outptr = &out[0];
int i, j; int i, j;
...@@ -1366,3 +1369,27 @@ void vp9_fdct32x32_rd_c(const int16_t *input, int16_t *out, int stride) { ...@@ -1366,3 +1369,27 @@ void vp9_fdct32x32_rd_c(const int16_t *input, int16_t *out, int stride) {
out[j + i * 32] = temp_out[j]; out[j + i * 32] = temp_out[j];
} }
} }
void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride) {
if (tx_type == DCT_DCT)
vp9_fdct4x4(input, output, stride);
else
vp9_short_fht4x4(input, output, stride, tx_type);
}
void vp9_fht8x8(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride) {
if (tx_type == DCT_DCT)
vp9_fdct8x8(input, output, stride);
else
vp9_short_fht8x8(input, output, stride, tx_type);
}
void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride) {
if (tx_type == DCT_DCT)
vp9_fdct16x16(input, output, stride);
else
vp9_short_fht16x16(input, output, stride, tx_type);
}
/*
* Copyright (c) 2013 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_ENCODER_VP9_DCT_H_
#define VP9_ENCODER_VP9_DCT_H_
void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride);
void vp9_fht8x8(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride);
void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
int stride);
#endif // VP9_ENCODER_VP9_DCT_H_
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "vp9/common/vp9_reconintra.h" #include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_systemdependent.h" #include "vp9/common/vp9_systemdependent.h"
#include "vp9/encoder/vp9_dct.h"
#include "vp9/encoder/vp9_encodemb.h" #include "vp9/encoder/vp9_encodemb.h"
#include "vp9/encoder/vp9_quantize.h" #include "vp9/encoder/vp9_quantize.h"
#include "vp9/encoder/vp9_rdopt.h" #include "vp9/encoder/vp9_rdopt.h"
...@@ -577,10 +578,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, ...@@ -577,10 +578,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
dst, pd->dst.stride, dst, pd->dst.stride); dst, pd->dst.stride, dst, pd->dst.stride);
vp9_subtract_block(16, 16, src_diff, bw * 4, vp9_subtract_block(16, 16, src_diff, bw * 4,
src, p->src.stride, dst, pd->dst.stride); src, p->src.stride, dst, pd->dst.stride);
if (tx_type != DCT_DCT) vp9_fht16x16(tx_type, src_diff, coeff, bw * 4);
vp9_short_fht16x16(src_diff, coeff, bw * 4, tx_type);
else
vp9_fdct16x16(src_diff, coeff, bw * 4);
vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round, vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff, p->quant, p->quant_shift, qcoeff, dqcoeff,
pd->dequant, p->zbin_extra, eob, scan, iscan); pd->dequant, p->zbin_extra, eob, scan, iscan);
...@@ -602,10 +600,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize, ...@@ -602,10 +600,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
dst, pd->dst.stride, dst, pd->dst.stride); dst, pd->dst.stride, dst, pd->dst.stride);
vp9_subtract_block(8, 8, src_diff, bw * 4, vp9_subtract_block(8, 8, src_diff, bw * 4,
src, p->src.stride, dst, pd->dst.stride); src, p->src.stride, dst, pd->dst.stride);
if (tx_type != DCT_DCT) vp9_fht8x8(tx_type, src_diff, coeff, bw * 4);
vp9_short_fht8x8(src_diff, coeff, bw * 4, tx_type);
else
vp9_fdct8x8(src_diff, coeff, bw * 4);
vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant, vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant,
p->quant_shift, qcoeff, dqcoeff, p->quant_shift, qcoeff, dqcoeff,
pd->dequant, p->zbin_extra, eob, scan, iscan); pd->dequant, p->zbin_extra, eob, scan, iscan);
......
...@@ -20,6 +20,7 @@ VP9_CX_SRCS-yes += vp9_cx_iface.c ...@@ -20,6 +20,7 @@ VP9_CX_SRCS-yes += vp9_cx_iface.c
VP9_CX_SRCS-yes += encoder/vp9_bitstream.c VP9_CX_SRCS-yes += encoder/vp9_bitstream.c
VP9_CX_SRCS-yes += encoder/vp9_boolhuff.c VP9_CX_SRCS-yes += encoder/vp9_boolhuff.c
VP9_CX_SRCS-yes += encoder/vp9_dct.c VP9_CX_SRCS-yes += encoder/vp9_dct.c
VP9_CX_SRCS-yes += encoder/vp9_dct.h
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h
VP9_CX_SRCS-yes += encoder/vp9_encodeintra.c VP9_CX_SRCS-yes += encoder/vp9_encodeintra.c
......
Supports Markdown
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