Commit 501acee3 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Tim Terriberry
Browse files

Fix bustage caused by 8089315a with daala_tx.

The inverse transform API was changed to pass in an unpadded 32x32
block of coefficients for transforms larger than 32x32, but the
code path actually used for daala_tx was not modified to pad it out
to the full size like the others were.

Change-Id: Ibda5d20a9d839ba41f8a1a0308c414111219da92
parent 17be4d8b
......@@ -1430,7 +1430,7 @@ static INLINE void transpose_int32(int32_t *dst, int dst_stride,
}
static INLINE int av1_get_max_eob(TX_SIZE tx_size) {
#if CONFIG_TX64X64 && !CONFIG_DAALA_TX
#if CONFIG_TX64X64
if (tx_size == TX_64X64 || tx_size == TX_64X32 || tx_size == TX_32X64) {
return 1024;
}
......
......@@ -87,12 +87,42 @@ void daala_inv_txfm_add_c(const tran_low_t *input_coeffs, void *output_pixels,
int col_flip = tx_flip(vtx_tab[tx_type]);
int row_flip = tx_flip(htx_tab[tx_type]);
od_coeff tmpsq[MAX_TX_SQUARE];
#if CONFIG_TX64X64
tran_low_t pad_input[MAX_TX_SQUARE];
#endif
int r;
int c;
assert(col_tx);
assert(row_tx);
#if CONFIG_TX64X64
if (rows > 32 || cols > 32) {
int avail_rows;
int avail_cols;
// TODO(urvang): Can the same array be reused, instead of using a new
// array?
// Remap 32x32 input into a modified input by:
// - Copying over these values in top-left 32x32 locations.
// - Setting the rest of the locations to 0.
avail_rows = AOMMIN(rows, 32);
avail_cols = AOMMIN(cols, 32);
for (r = 0; r < avail_rows; r++) {
memcpy(pad_input + r * cols, input_coeffs + r * avail_cols,
avail_cols * sizeof(*pad_input));
if (cols > avail_cols) {
memset(pad_input + r * cols + avail_cols, 0,
(cols - avail_cols) * sizeof(*pad_input));
}
}
if (rows > avail_rows) {
memset(pad_input + avail_rows * cols, 0,
(rows - avail_rows) * cols * sizeof(*pad_input));
}
input_coeffs = pad_input;
}
#endif
// Inverse-transform rows
for (r = 0; r < rows; ++r) {
// The output addressing transposes
......
......@@ -108,6 +108,19 @@ void daala_fwd_txfm(const int16_t *input_pixels, tran_low_t *output_coeffs,
else
row_tx(output_coeffs + r * cols, output_coeffs + r * cols, 1);
}
#if CONFIG_TX64X64
// Re-pack coeffs in the first 32x32 indices.
if (cols > 32) {
int avail_rows;
int avail_cols;
avail_rows = AOMMIN(rows, 32);
avail_cols = AOMMIN(cols, 32);
for (r = 1; r < avail_rows; r++) {
memmove(output_coeffs + r * avail_cols, output_coeffs + r * cols,
avail_cols * sizeof(*output_coeffs));
}
}
#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