Commit 845057f1 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Support for 4:1 transforms with txmg

Change-Id: I484121349af182f4f9525b1c992a6e77f6da7ea9
parent 0797a208
......@@ -412,3 +412,63 @@ void av1_inv_txfm2d_add_32x64_c(const int32_t *input, uint16_t *output,
inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_32X64, bd);
}
#endif // CONFIG_TX64X64
#if CONFIG_RECT_TX_EXT || (CONFIG_EXT_PARTITION_TYPES && USE_RECT_TX_EXT)
void av1_inv_txfm2d_add_4x16_c(const int32_t *input, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
int txfm_buf[4 * 16 + 16 + 16];
inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_4X16, bd);
}
void av1_inv_txfm2d_add_16x4_c(const int32_t *input, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
#if CONFIG_TXMG
int txfm_buf[4 * 16 + 16 + 16];
int32_t rinput[4 * 16];
uint16_t routput[4 * 16];
TX_SIZE tx_size = TX_16X4;
TX_SIZE rtx_size = av1_rotate_tx_size(tx_size);
TX_TYPE rtx_type = av1_rotate_tx_type(tx_type);
int w = tx_size_wide[tx_size];
int h = tx_size_high[tx_size];
int rw = h;
int rh = w;
transpose_int32(rinput, rw, input, w, w, h);
transpose_uint16(routput, rw, output, stride, w, h);
inv_txfm2d_add_facade(rinput, routput, rw, txfm_buf, rtx_type, rtx_size, bd);
transpose_uint16(output, stride, routput, rw, rw, rh);
#else
int txfm_buf[4 * 16 + 16 + 16];
inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_16X4, bd);
#endif // CONFIG_TXMG
}
void av1_inv_txfm2d_add_8x32_c(const int32_t *input, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
int txfm_buf[8 * 32 + 32 + 32];
inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_8X32, bd);
}
void av1_inv_txfm2d_add_32x8_c(const int32_t *input, uint16_t *output,
int stride, TX_TYPE tx_type, int bd) {
#if CONFIG_TXMG
int txfm_buf[8 * 32 + 32 + 32];
int32_t rinput[8 * 32];
uint16_t routput[8 * 32];
TX_SIZE tx_size = TX_32X8;
TX_SIZE rtx_size = av1_rotate_tx_size(tx_size);
TX_TYPE rtx_type = av1_rotate_tx_type(tx_type);
int w = tx_size_wide[tx_size];
int h = tx_size_high[tx_size];
int rw = h;
int rh = w;
transpose_int32(rinput, rw, input, w, w, h);
transpose_uint16(routput, rw, output, stride, w, h);
inv_txfm2d_add_facade(rinput, routput, rw, txfm_buf, rtx_type, rtx_size, bd);
transpose_uint16(output, stride, routput, rw, rw, rh);
#else
int txfm_buf[8 * 32 + 32 + 32];
inv_txfm2d_add_facade(input, output, stride, txfm_buf, tx_type, TX_32X8, bd);
#endif // CONFIG_TXMG
}
#endif
......@@ -256,6 +256,10 @@ if (aom_config("CONFIG_TX64X64") eq "yes") {
add_proto qw/void av1_inv_txfm2d_add_64x32/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
add_proto qw/void av1_inv_txfm2d_add_32x64/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
}
add_proto qw/void av1_inv_txfm2d_add_4x16/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
add_proto qw/void av1_inv_txfm2d_add_16x4/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
add_proto qw/void av1_inv_txfm2d_add_8x32/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
add_proto qw/void av1_inv_txfm2d_add_32x8/, "const int32_t *input, uint16_t *output, int stride, TX_TYPE tx_type, int bd";
#
# Encoder functions below this point.
......
......@@ -38,7 +38,7 @@ extern "C" {
#define MAX_SB_SQUARE (MAX_SB_SIZE * MAX_SB_SIZE)
#if CONFIG_EXT_PARTITION_TYPES
#define USE_RECT_TX_EXT 0
#define USE_RECT_TX_EXT 1
#endif
// Min superblock size
......
......@@ -2182,6 +2182,36 @@ static void highbd_inv_txfm_add_32x16(const tran_low_t *input, uint8_t *dest,
txfm_param->tx_type, txfm_param->bd);
}
#if CONFIG_RECT_TX_EXT || (CONFIG_EXT_PARTITION_TYPES && USE_RECT_TX_EXT)
static void highbd_inv_txfm_add_16x4(const tran_low_t *input, uint8_t *dest,
int stride, const TxfmParam *txfm_param) {
const int32_t *src = cast_to_int32(input);
av1_inv_txfm2d_add_16x4_c(src, CONVERT_TO_SHORTPTR(dest), stride,
txfm_param->tx_type, txfm_param->bd);
}
static void highbd_inv_txfm_add_4x16(const tran_low_t *input, uint8_t *dest,
int stride, const TxfmParam *txfm_param) {
const int32_t *src = cast_to_int32(input);
av1_inv_txfm2d_add_4x16_c(src, CONVERT_TO_SHORTPTR(dest), stride,
txfm_param->tx_type, txfm_param->bd);
}
static void highbd_inv_txfm_add_32x8(const tran_low_t *input, uint8_t *dest,
int stride, const TxfmParam *txfm_param) {
const int32_t *src = cast_to_int32(input);
av1_inv_txfm2d_add_32x8_c(src, CONVERT_TO_SHORTPTR(dest), stride,
txfm_param->tx_type, txfm_param->bd);
}
static void highbd_inv_txfm_add_8x32(const tran_low_t *input, uint8_t *dest,
int stride, const TxfmParam *txfm_param) {
const int32_t *src = cast_to_int32(input);
av1_inv_txfm2d_add_8x32_c(src, CONVERT_TO_SHORTPTR(dest), stride,
txfm_param->tx_type, txfm_param->bd);
}
#endif
#if CONFIG_TX64X64
static void highbd_inv_txfm_add_32x64(const tran_low_t *input, uint8_t *dest,
int stride, const TxfmParam *txfm_param) {
......@@ -2543,6 +2573,20 @@ void av1_highbd_inv_txfm_add(const tran_low_t *input, uint8_t *dest, int stride,
// case.
av1_highbd_inv_txfm_add_4x4(input, dest, stride, txfm_param);
break;
#if CONFIG_RECT_TX_EXT || (CONFIG_EXT_PARTITION_TYPES && USE_RECT_TX_EXT)
case TX_16X4:
highbd_inv_txfm_add_16x4(input, dest, stride, txfm_param);
break;
case TX_4X16:
highbd_inv_txfm_add_4x16(input, dest, stride, txfm_param);
break;
case TX_8X32:
highbd_inv_txfm_add_8x32(input, dest, stride, txfm_param);
break;
case TX_32X8:
highbd_inv_txfm_add_32x8(input, dest, stride, txfm_param);
break;
#endif
default: assert(0 && "Invalid transform size"); break;
}
}
......@@ -247,6 +247,28 @@ static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
txfm_param->bd);
}
#if CONFIG_RECT_TX_EXT || (CONFIG_EXT_PARTITION_TYPES && USE_RECT_TX_EXT)
static void highbd_fwd_txfm_16x4(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TxfmParam *txfm_param) {
av1_fht16x4(src_diff, coeff, diff_stride, txfm_param);
}
static void highbd_fwd_txfm_4x16(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TxfmParam *txfm_param) {
av1_fht4x16(src_diff, coeff, diff_stride, txfm_param);
}
static void highbd_fwd_txfm_32x8(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TxfmParam *txfm_param) {
av1_fht32x8(src_diff, coeff, diff_stride, txfm_param);
}
static void highbd_fwd_txfm_8x32(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TxfmParam *txfm_param) {
av1_fht8x32(src_diff, coeff, diff_stride, txfm_param);
}
#endif
static void highbd_fwd_txfm_8x8(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TxfmParam *txfm_param) {
int32_t *dst_coeff = (int32_t *)coeff;
......@@ -571,6 +593,20 @@ void av1_highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff,
case TX_4X4:
highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, txfm_param);
break;
#if CONFIG_RECT_TX_EXT || (CONFIG_EXT_PARTITION_TYPES && USE_RECT_TX_EXT)
case TX_4X16:
highbd_fwd_txfm_4x16(src_diff, coeff, diff_stride, txfm_param);
break;
case TX_16X4:
highbd_fwd_txfm_16x4(src_diff, coeff, diff_stride, txfm_param);
break;
case TX_8X32:
highbd_fwd_txfm_8x32(src_diff, coeff, diff_stride, txfm_param);
break;
case TX_32X8:
highbd_fwd_txfm_32x8(src_diff, coeff, diff_stride, txfm_param);
break;
#endif
default: assert(0); break;
}
#endif
......
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