Commit 21a0c2c9 authored by clang-format's avatar clang-format Committed by James Zern

apply clang-format

after:
253c001f Port dering experiment from aom
72081457 Adding 8x16/16x8/32x16/16x32 transforms

Change-Id: Id93e0d7b72a128701d8dec35fc2fac473944d0c1
parent 0996fc6b
......@@ -34,8 +34,9 @@ using libvpx_test::ACMRandom;
TEST(Daala, TestDIVUuptoMAX) {
for (int d = 1; d <= OD_DIVU_DMAX; d++) {
for (uint32_t x = 1; x <= 1000000; x++) {
GTEST_ASSERT_EQ(x/d, OD_DIVU_SMALL(x, d)) << "x=" << x << " d=" << d <<
" x/d=" << (x/d) << " != " << OD_DIVU_SMALL(x, d);
GTEST_ASSERT_EQ(x / d, OD_DIVU_SMALL(x, d))
<< "x=" << x << " d=" << d << " x/d=" << (x / d)
<< " != " << OD_DIVU_SMALL(x, d);
}
}
}
......@@ -45,8 +46,9 @@ TEST(Daala, TestDIVUrandI31) {
for (int d = 1; d < OD_DIVU_DMAX; d++) {
for (int i = 0; i < 1000000; i++) {
uint32_t x = rnd.Rand31();
GTEST_ASSERT_EQ(x/d, OD_DIVU_SMALL(x, d)) << "x=" << x << " d=" << d <<
" x/d=" << (x/d) << " != " << OD_DIVU_SMALL(x, d);
GTEST_ASSERT_EQ(x / d, OD_DIVU_SMALL(x, d))
<< "x=" << x << " d=" << d << " x/d=" << (x / d)
<< " != " << OD_DIVU_SMALL(x, d);
}
}
}
......@@ -61,9 +61,9 @@ static const uint8_t num_16x16_blocks_high_lookup[BLOCK_SIZES] = {
};
static const uint8_t num_4x4_blocks_txsize_lookup[TX_SIZES_ALL] = {
1, 4, 16, 64,
1, 4, 16, 64,
#if CONFIG_EXT_TX
2, 2, 8, 8, 32, 32
2, 2, 8, 8, 32, 32
#endif // CONFIG_EXT_TX
};
static const uint8_t num_4x4_blocks_wide_txsize_lookup[TX_SIZES_ALL] = {
......@@ -380,7 +380,7 @@ static const BLOCK_SIZE txsize_to_bsize[TX_SIZES_ALL] = {
BLOCK_16X8, // TX_16X8
BLOCK_16X32, // TX_16X32
BLOCK_32X16, // TX_32X16
#endif // CONFIG_EXT_TX
#endif // CONFIG_EXT_TX
};
static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = {
......@@ -395,7 +395,7 @@ static const TX_SIZE txsize_sqr_map[TX_SIZES_ALL] = {
TX_8X8, // TX_16X8
TX_16X16, // TX_16X32
TX_16X16, // TX_32X16
#endif // CONFIG_EXT_TX
#endif // CONFIG_EXT_TX
};
static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = {
......@@ -410,7 +410,7 @@ static const TX_SIZE txsize_sqr_up_map[TX_SIZES_ALL] = {
TX_16X16, // TX_16X8
TX_32X32, // TX_16X32
TX_32X32, // TX_32X16
#endif // CONFIG_EXT_TX
#endif // CONFIG_EXT_TX
};
static const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = {
......
......@@ -18,13 +18,12 @@
#include "vp10/common/reconinter.h"
#include "vp10/common/od_dering.h"
int compute_level_from_index(int global_level, int gi) {
static const int dering_gains[DERING_REFINEMENT_LEVELS] = {0, 11, 16, 22};
static const int dering_gains[DERING_REFINEMENT_LEVELS] = { 0, 11, 16, 22 };
int level;
if (global_level == 0) return 0;
level = (global_level*dering_gains[gi] + 8) >> 4;
return clamp(level, gi, MAX_DERING_LEVEL-1);
level = (global_level * dering_gains[gi] + 8) >> 4;
return clamp(level, gi, MAX_DERING_LEVEL - 1);
}
int sb_all_skip(const VP10_COMMON *const cm, int mi_row, int mi_col) {
......@@ -38,8 +37,8 @@ int sb_all_skip(const VP10_COMMON *const cm, int mi_row, int mi_col) {
for (r = 0; r < maxr; r++) {
for (c = 0; c < maxc; c++) {
skip = skip &&
cm->mi_grid_visible[(mi_row + r)*cm->mi_stride + mi_col + c]->
mbmi.skip;
cm->mi_grid_visible[(mi_row + r) * cm->mi_stride + mi_col + c]
->mbmi.skip;
}
}
return skip;
......@@ -52,30 +51,29 @@ void vp10_dering_frame(YV12_BUFFER_CONFIG *frame, VP10_COMMON *cm,
int nhsb, nvsb;
od_dering_in *src[3];
unsigned char *bskip;
int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS] = {{0}};
int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS] = { { 0 } };
int stride;
int bsize[3];
int dec[3];
int pli;
int coeff_shift = VPXMAX(cm->bit_depth - 8, 0);
nvsb = (cm->mi_rows + MI_BLOCK_SIZE - 1)/MI_BLOCK_SIZE;
nhsb = (cm->mi_cols + MI_BLOCK_SIZE - 1)/MI_BLOCK_SIZE;
bskip = vpx_malloc(sizeof(*bskip)*cm->mi_rows*cm->mi_cols);
nvsb = (cm->mi_rows + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
nhsb = (cm->mi_cols + MI_BLOCK_SIZE - 1) / MI_BLOCK_SIZE;
bskip = vpx_malloc(sizeof(*bskip) * cm->mi_rows * cm->mi_cols);
vp10_setup_dst_planes(xd->plane, frame, 0, 0);
for (pli = 0; pli < 3; pli++) {
dec[pli] = xd->plane[pli].subsampling_x;
bsize[pli] = 8 >> dec[pli];
}
stride = bsize[0]*cm->mi_cols;
stride = bsize[0] * cm->mi_cols;
for (pli = 0; pli < 3; pli++) {
src[pli] = vpx_malloc(sizeof(*src)*cm->mi_rows*cm->mi_cols*64);
for (r = 0; r < bsize[pli]*cm->mi_rows; ++r) {
for (c = 0; c < bsize[pli]*cm->mi_cols; ++c) {
src[pli] = vpx_malloc(sizeof(*src) * cm->mi_rows * cm->mi_cols * 64);
for (r = 0; r < bsize[pli] * cm->mi_rows; ++r) {
for (c = 0; c < bsize[pli] * cm->mi_cols; ++c) {
#if CONFIG_VPX_HIGHBITDEPTH
if (cm->use_highbitdepth) {
src[pli][r * stride + c] =
CONVERT_TO_SHORTPTR(xd->plane[pli].dst.buf)
[r * xd->plane[pli].dst.stride + c];
src[pli][r * stride + c] = CONVERT_TO_SHORTPTR(
xd->plane[pli].dst.buf)[r * xd->plane[pli].dst.stride + c];
} else {
#endif
src[pli][r * stride + c] =
......@@ -97,46 +95,48 @@ void vp10_dering_frame(YV12_BUFFER_CONFIG *frame, VP10_COMMON *cm,
for (sbc = 0; sbc < nhsb; sbc++) {
int level;
int nhb, nvb;
nhb = VPXMIN(MI_BLOCK_SIZE, cm->mi_cols - MI_BLOCK_SIZE*sbc);
nvb = VPXMIN(MI_BLOCK_SIZE, cm->mi_rows - MI_BLOCK_SIZE*sbr);
nhb = VPXMIN(MI_BLOCK_SIZE, cm->mi_cols - MI_BLOCK_SIZE * sbc);
nvb = VPXMIN(MI_BLOCK_SIZE, cm->mi_rows - MI_BLOCK_SIZE * sbr);
for (pli = 0; pli < 3; pli++) {
int16_t dst[MI_BLOCK_SIZE*MI_BLOCK_SIZE*8*8];
int16_t dst[MI_BLOCK_SIZE * MI_BLOCK_SIZE * 8 * 8];
int threshold;
#if DERING_REFINEMENT
level = compute_level_from_index(
global_level,
cm->mi_grid_visible[MI_BLOCK_SIZE*sbr*cm->mi_stride +
MI_BLOCK_SIZE*sbc]->mbmi.dering_gain);
cm->mi_grid_visible[MI_BLOCK_SIZE * sbr * cm->mi_stride +
MI_BLOCK_SIZE * sbc]
->mbmi.dering_gain);
#else
level = global_level;
level = global_level;
#endif
/* FIXME: This is a temporary hack that uses more conservative
deringing for chroma. */
if (pli) level = (level*5 + 4) >> 3;
if (sb_all_skip(cm, sbr*MI_BLOCK_SIZE, sbc*MI_BLOCK_SIZE)) level = 0;
if (pli) level = (level * 5 + 4) >> 3;
if (sb_all_skip(cm, sbr * MI_BLOCK_SIZE, sbc * MI_BLOCK_SIZE))
level = 0;
threshold = level << coeff_shift;
od_dering(
&OD_DERING_VTBL_C,
dst,
MI_BLOCK_SIZE*bsize[pli],
&src[pli][sbr*stride*bsize[pli]*MI_BLOCK_SIZE +
sbc*bsize[pli]*MI_BLOCK_SIZE],
&OD_DERING_VTBL_C, dst, MI_BLOCK_SIZE * bsize[pli],
&src[pli][sbr * stride * bsize[pli] * MI_BLOCK_SIZE +
sbc * bsize[pli] * MI_BLOCK_SIZE],
stride, nhb, nvb, sbc, sbr, nhsb, nvsb, dec[pli], dir, pli,
&bskip[MI_BLOCK_SIZE*sbr*cm->mi_cols + MI_BLOCK_SIZE*sbc],
&bskip[MI_BLOCK_SIZE * sbr * cm->mi_cols + MI_BLOCK_SIZE * sbc],
cm->mi_cols, threshold, OD_DERING_NO_CHECK_OVERLAP, coeff_shift);
for (r = 0; r < bsize[pli]*nvb; ++r) {
for (c = 0; c < bsize[pli]*nhb; ++c) {
for (r = 0; r < bsize[pli] * nvb; ++r) {
for (c = 0; c < bsize[pli] * nhb; ++c) {
#if CONFIG_VPX_HIGHBITDEPTH
if (cm->use_highbitdepth) {
CONVERT_TO_SHORTPTR(xd->plane[pli].dst.buf)
[xd->plane[pli].dst.stride*(bsize[pli]*MI_BLOCK_SIZE*sbr + r)
+ sbc*bsize[pli]*MI_BLOCK_SIZE + c] =
[xd->plane[pli].dst.stride *
(bsize[pli] * MI_BLOCK_SIZE * sbr + r) +
sbc * bsize[pli] * MI_BLOCK_SIZE + c] =
dst[r * MI_BLOCK_SIZE * bsize[pli] + c];
} else {
#endif
xd->plane[pli].dst.buf[xd->plane[pli].dst.stride*
(bsize[pli]*MI_BLOCK_SIZE*sbr + r) +
sbc*bsize[pli]*MI_BLOCK_SIZE + c] =
xd->plane[pli]
.dst.buf[xd->plane[pli].dst.stride *
(bsize[pli] * MI_BLOCK_SIZE * sbr + r) +
sbc * bsize[pli] * MI_BLOCK_SIZE + c] =
dst[r * MI_BLOCK_SIZE * bsize[pli] + c];
#if CONFIG_VPX_HIGHBITDEPTH
}
......
......@@ -24,8 +24,7 @@ void vp10_dering_frame(YV12_BUFFER_CONFIG *frame, VP10_COMMON *cm,
MACROBLOCKD *xd, int global_level);
int vp10_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
VP10_COMMON *cm,
MACROBLOCKD *xd);
VP10_COMMON *cm, MACROBLOCKD *xd);
#ifdef __cplusplus
} // extern "C"
......
......@@ -59,12 +59,9 @@ const uint16_t band_count_table[TX_SIZES_ALL][8] = {
{ 1, 2, 3, 4, 3, 16 - 13, 0 }, { 1, 2, 3, 4, 11, 64 - 21, 0 },
{ 1, 2, 3, 4, 11, 256 - 21, 0 }, { 1, 2, 3, 4, 11, 1024 - 21, 0 },
#if CONFIG_EXT_TX
{ 1, 2, 3, 4, 8, 32 - 18, 0 },
{ 1, 2, 3, 4, 8, 32 - 18, 0 },
{ 1, 2, 3, 4, 11, 128 - 21, 0 },
{ 1, 2, 3, 4, 11, 128 - 21, 0 },
{ 1, 2, 3, 4, 11, 512 - 21, 0 },
{ 1, 2, 3, 4, 11, 512 - 21, 0 },
{ 1, 2, 3, 4, 8, 32 - 18, 0 }, { 1, 2, 3, 4, 8, 32 - 18, 0 },
{ 1, 2, 3, 4, 11, 128 - 21, 0 }, { 1, 2, 3, 4, 11, 128 - 21, 0 },
{ 1, 2, 3, 4, 11, 512 - 21, 0 }, { 1, 2, 3, 4, 11, 512 - 21, 0 },
#endif // CONFIG_EXT_TX
};
......@@ -72,12 +69,9 @@ const uint16_t band_cum_count_table[TX_SIZES_ALL][8] = {
{ 0, 1, 3, 6, 10, 13, 16, 0 }, { 0, 1, 3, 6, 10, 21, 64, 0 },
{ 0, 1, 3, 6, 10, 21, 256, 0 }, { 0, 1, 3, 6, 10, 21, 1024, 0 },
#if CONFIG_EXT_TX
{ 0, 1, 3, 6, 10, 18, 32, 0 },
{ 0, 1, 3, 6, 10, 18, 32, 0 },
{ 0, 1, 3, 6, 10, 21, 128, 0 },
{ 0, 1, 3, 6, 10, 21, 128, 0 },
{ 0, 1, 3, 6, 10, 21, 512, 0 },
{ 0, 1, 3, 6, 10, 21, 512, 0 },
{ 0, 1, 3, 6, 10, 18, 32, 0 }, { 0, 1, 3, 6, 10, 18, 32, 0 },
{ 0, 1, 3, 6, 10, 21, 128, 0 }, { 0, 1, 3, 6, 10, 21, 128, 0 },
{ 0, 1, 3, 6, 10, 21, 512, 0 }, { 0, 1, 3, 6, 10, 21, 512, 0 },
#endif // CONFIG_EXT_TX
};
......
......@@ -168,8 +168,7 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
switch (tx_size) {
case TX_4X4: return vp10_coefband_trans_4x4;
#if CONFIG_EXT_TX
case TX_4X8:
return vp10_coefband_trans_4x8_8x4;
case TX_4X8: return vp10_coefband_trans_4x8_8x4;
#endif // CONFIG_EXT_TX
default: return vp10_coefband_trans_8x8plus;
}
......@@ -230,19 +229,19 @@ static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
break;
case TX_8X16:
above_ec = !!*(const uint16_t *)a;
left_ec = !!*(const uint32_t *)l;
left_ec = !!*(const uint32_t *)l;
break;
case TX_16X8:
above_ec = !!*(const uint32_t *)a;
left_ec = !!*(const uint16_t *)l;
left_ec = !!*(const uint16_t *)l;
break;
case TX_16X32:
above_ec = !!*(const uint32_t *)a;
left_ec = !!*(const uint64_t *)l;
left_ec = !!*(const uint64_t *)l;
break;
case TX_32X16:
above_ec = !!*(const uint64_t *)a;
left_ec = !!*(const uint32_t *)l;
left_ec = !!*(const uint32_t *)l;
break;
#endif // CONFIG_EXT_TX
case TX_8X8:
......
......@@ -138,12 +138,12 @@ typedef uint8_t TX_SIZE;
#define TX_SIZES ((TX_SIZE)4)
#if CONFIG_EXT_TX
#define TX_4X8 ((TX_SIZE)4) // 4x8 transform
#define TX_8X4 ((TX_SIZE)5) // 8x4 transform
#define TX_8X16 ((TX_SIZE)6) // 8x16 transform
#define TX_16X8 ((TX_SIZE)7) // 16x8 transform
#define TX_16X32 ((TX_SIZE)8) // 16x32 transform
#define TX_32X16 ((TX_SIZE)9) // 32x16 transform
#define TX_4X8 ((TX_SIZE)4) // 4x8 transform
#define TX_8X4 ((TX_SIZE)5) // 8x4 transform
#define TX_8X16 ((TX_SIZE)6) // 8x16 transform
#define TX_16X8 ((TX_SIZE)7) // 16x8 transform
#define TX_16X32 ((TX_SIZE)8) // 16x32 transform
#define TX_32X16 ((TX_SIZE)9) // 32x16 transform
#define TX_SIZES_ALL ((TX_SIZE)10) // Includes rectangular transforms
#else
#define TX_SIZES_ALL ((TX_SIZE)4)
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,14 +23,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
#if !defined(_dering_H)
# define _dering_H (1)
#define _dering_H (1)
# include "odintrin.h"
#include "odintrin.h"
# if defined(DAALA_ODINTRIN)
# include "filter.h"
#if defined(DAALA_ODINTRIN)
#include "filter.h"
typedef int16_t od_dering_in;
# endif
#endif
#define OD_DERINGSIZES (2)
......@@ -40,18 +40,21 @@ typedef int16_t od_dering_in;
#define OD_DERING_LEVELS (6)
extern const double OD_DERING_GAIN_TABLE[OD_DERING_LEVELS];
#define OD_DERING_NBLOCKS (OD_BSIZE_MAX/8)
#define OD_DERING_NBLOCKS (OD_BSIZE_MAX / 8)
#define OD_FILT_BORDER (3)
#define OD_FILT_BSTRIDE (OD_BSIZE_MAX + 2*OD_FILT_BORDER)
#define OD_FILT_BSTRIDE (OD_BSIZE_MAX + 2 * OD_FILT_BORDER)
extern const int OD_DIRECTION_OFFSETS_TABLE[8][3];
typedef void (*od_filter_dering_direction_func)(int16_t *y, int ystride,
const int16_t *in, int threshold, int dir);
const int16_t *in,
int threshold, int dir);
typedef void (*od_filter_dering_orthogonal_func)(int16_t *y, int ystride,
const int16_t *in, const od_dering_in *x, int xstride, int threshold,
int dir);
const int16_t *in,
const od_dering_in *x,
int xstride, int threshold,
int dir);
struct od_dering_opt_vtbl {
od_filter_dering_direction_func filter_dering_direction[OD_DERINGSIZES];
......@@ -59,28 +62,31 @@ struct od_dering_opt_vtbl {
};
typedef struct od_dering_opt_vtbl od_dering_opt_vtbl;
void od_dering(const od_dering_opt_vtbl *vtbl, int16_t *y, int ystride,
const od_dering_in *x, int xstride, int nvb, int nhb, int sbx, int sby,
int nhsb, int nvsb, int xdec, int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS],
int pli, unsigned char *bskip, int skip_stride, int threshold, int overlap,
int coeff_shift);
const od_dering_in *x, int xstride, int nvb, int nhb, int sbx,
int sby, int nhsb, int nvsb, int xdec,
int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS], int pli,
unsigned char *bskip, int skip_stride, int threshold,
int overlap, int coeff_shift);
void od_filter_dering_direction_c(int16_t *y, int ystride, const int16_t *in,
int ln, int threshold, int dir);
int ln, int threshold, int dir);
void od_filter_dering_orthogonal_c(int16_t *y, int ystride, const int16_t *in,
const od_dering_in *x, int xstride, int ln, int threshold, int dir);
const od_dering_in *x, int xstride, int ln,
int threshold, int dir);
extern const od_dering_opt_vtbl OD_DERING_VTBL_C;
void od_filter_dering_direction_4x4_c(int16_t *y, int ystride,
const int16_t *in, int threshold, int dir);
const int16_t *in, int threshold,
int dir);
void od_filter_dering_direction_8x8_c(int16_t *y, int ystride,
const int16_t *in, int threshold, int dir);
const int16_t *in, int threshold,
int dir);
void od_filter_dering_orthogonal_4x4_c(int16_t *y, int ystride,
const int16_t *in, const od_dering_in *x, int xstride, int threshold,
int dir);
const int16_t *in, const od_dering_in *x,
int xstride, int threshold, int dir);
void od_filter_dering_orthogonal_8x8_c(int16_t *y, int ystride,
const int16_t *in, const od_dering_in *x, int xstride, int threshold,
int dir);
const int16_t *in, const od_dering_in *x,
int xstride, int threshold, int dir);
#endif
This diff is collapsed.
......@@ -7,41 +7,42 @@
#include "vpx_ports/bitops.h"
/*Smallest blocks are 4x4*/
# define OD_LOG_BSIZE0 (2)
#define OD_LOG_BSIZE0 (2)
/*There are 5 block sizes total (4x4, 8x8, 16x16, 32x32 and 64x64).*/
# define OD_NBSIZES (5)
#define OD_NBSIZES (5)
/*The log of the maximum length of the side of a block.*/
# define OD_LOG_BSIZE_MAX (OD_LOG_BSIZE0 + OD_NBSIZES - 1)
#define OD_LOG_BSIZE_MAX (OD_LOG_BSIZE0 + OD_NBSIZES - 1)
/*The maximum length of the side of a block.*/
# define OD_BSIZE_MAX (1 << OD_LOG_BSIZE_MAX)
#define OD_BSIZE_MAX (1 << OD_LOG_BSIZE_MAX)
typedef int od_coeff;
typedef int16_t od_dering_in;
# define OD_DIVU_DMAX (1024)
#define OD_DIVU_DMAX (1024)
extern uint32_t OD_DIVU_SMALL_CONSTS[OD_DIVU_DMAX][2];
/*Translate unsigned division by small divisors into multiplications.*/
# define OD_DIVU_SMALL(_x, _d) \
((uint32_t)((OD_DIVU_SMALL_CONSTS[(_d)-1][0]* \
(uint64_t)(_x)+OD_DIVU_SMALL_CONSTS[(_d)-1][1])>>32)>> \
(OD_ILOG(_d)-1))
#define OD_DIVU_SMALL(_x, _d) \
((uint32_t)((OD_DIVU_SMALL_CONSTS[(_d)-1][0] * (uint64_t)(_x) + \
OD_DIVU_SMALL_CONSTS[(_d)-1][1]) >> \
32) >> \
(OD_ILOG(_d) - 1))
# define OD_DIVU(_x, _d) \
(((_d) < OD_DIVU_DMAX)?(OD_DIVU_SMALL((_x), (_d))):((_x)/(_d)))
#define OD_DIVU(_x, _d) \
(((_d) < OD_DIVU_DMAX) ? (OD_DIVU_SMALL((_x), (_d))) : ((_x) / (_d)))
#define OD_MINI VPXMIN
#define OD_CLAMPI(min, val, max) clamp((val), (min), (max))
# define OD_CLZ0 (1)
# define OD_CLZ(x) (-get_msb(x))
# define OD_ILOG_NZ(x) (OD_CLZ0 - OD_CLZ(x))
#define OD_CLZ0 (1)
#define OD_CLZ(x) (-get_msb(x))
#define OD_ILOG_NZ(x) (OD_CLZ0 - OD_CLZ(x))
/*Note that __builtin_clz is not defined when x == 0, according to the gcc
documentation (and that of the x86 BSR instruction that implements it), so
we have to special-case it.
We define a special version of the macro to use when x can be zero.*/
# define OD_ILOG(x) ((x) ? OD_ILOG_NZ(x) : 0)
#define OD_ILOG(x) ((x) ? OD_ILOG_NZ(x) : 0)
#endif
This diff is collapsed.
......@@ -1783,10 +1783,11 @@ static void decode_partition(VP10Decoder *const pbi, MACROBLOCKD *const xd,
#if DERING_REFINEMENT
if (bsize == BLOCK_64X64) {
if (cm->dering_level != 0 && !sb_all_skip(cm, mi_row, mi_col)) {
cm->mi_grid_visible[mi_row*cm->mi_stride + mi_col]->mbmi.dering_gain =
cm->mi_grid_visible[mi_row * cm->mi_stride + mi_col]->mbmi.dering_gain =
vpx_read_literal(r, DERING_REFINEMENT_BITS);
} else {
cm->mi_grid_visible[mi_row*cm->mi_stride + mi_col]->mbmi.dering_gain = 0;
cm->mi_grid_visible[mi_row * cm->mi_stride + mi_col]->mbmi.dering_gain =
0;
}
}
#endif // DERGING_REFINEMENT
......@@ -1967,7 +1968,7 @@ static void setup_clpf(VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
#if CONFIG_DERING
static void setup_dering(VP10_COMMON *cm, struct vpx_read_bit_buffer *rb) {
cm->dering_level = vpx_rb_read_literal(rb, DERING_LEVEL_BITS);
cm->dering_level = vpx_rb_read_literal(rb, DERING_LEVEL_BITS);
}
#endif // CONFIG_DERING
......@@ -3390,7 +3391,7 @@ static void read_global_motion_params(Global_Motion_Params *params,
GM_ALPHA_DECODE_FACTOR);
params->motion_params.wmmat[5] =
vp10_read_primitive_symmetric(r, GM_ABS_ALPHA_BITS) *
GM_ALPHA_DECODE_FACTOR +
GM_ALPHA_DECODE_FACTOR +
(1 << WARPEDMODEL_PREC_BITS);
// fallthrough intended
case GLOBAL_ROTZOOM:
......
......@@ -1883,7 +1883,8 @@ static void write_modes_sb(VP10_COMP *const cpi, const TileInfo *const tile,
if (bsize == BLOCK_64X64 && cm->dering_level != 0 &&
!sb_all_skip(cm, mi_row, mi_col)) {
vpx_write_literal(
w, cm->mi_grid_visible[mi_row*cm->mi_stride + mi_col]->mbmi.dering_gain,
w,
cm->mi_grid_visible[mi_row * cm->mi_stride + mi_col]->mbmi.dering_gain,
DERING_REFINEMENT_BITS);
}
#endif
......
This diff is collapsed.
......@@ -3349,8 +3349,8 @@ static void loopfilter_frame(VP10_COMP *cpi, VP10_COMMON *cm) {
if (is_lossless_requested(&cpi->oxcf)) {
cm->dering_level = 0;
} else {
cm->dering_level = vp10_dering_search(cm->frame_to_show, cpi->Source, cm,
xd);
cm->dering_level =
vp10_dering_search(cm->frame_to_show, cpi->Source, cm, xd);
vp10_dering_frame(cm->frame_to_show, cm, xd, cm->dering_level);
}
#endif // CONFIG_DERING
......
......@@ -58,42 +58,42 @@ static void fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
static void fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt) {
(void) fwd_txfm_opt;
(void)fwd_txfm_opt;
vp10_fht4x8(src_diff, coeff, diff_stride, tx_type);
}
static void fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt) {
(void) fwd_txfm_opt;
(void)fwd_txfm_opt;
vp10_fht8x4(src_diff, coeff, diff_stride, tx_type);
}
static void fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt) {
(void) fwd_txfm_opt;
(void)fwd_txfm_opt;
vp10_fht8x16(src_diff, coeff, diff_stride, tx_type);
}
static void fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt) {
(void) fwd_txfm_opt;
(void)fwd_txfm_opt;
vp10_fht16x8(src_diff, coeff, diff_stride, tx_type);
}
static void fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt) {
(void) fwd_txfm_opt;
(void)fwd_txfm_opt;
vp10_fht16x32(src_diff, coeff, diff_stride, tx_type);
}
static void fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt) {
(void) fwd_txfm_opt;
(void)fwd_txfm_opt;
vp10_fht32x16(src_diff, coeff, diff_stride, tx_type);
}
#endif // CONFIG_EXT_TX
......@@ -244,48 +244,48 @@ static void highbd_fwd_txfm_4x4(const int16_t *src_diff, tran_low_t *coeff,
static void highbd_fwd_txfm_4x8(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt, const int bd) {
(void) fwd_txfm_opt;
(void) bd;
(void)fwd_txfm_opt;
(void)bd;
vp10_highbd_fht4x8(src_diff, coeff, diff_stride, tx_type);
}
static void highbd_fwd_txfm_8x4(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt, const int bd) {
(void) fwd_txfm_opt;
(void) bd;
(void)fwd_txfm_opt;
(void)bd;
vp10_highbd_fht8x4(src_diff, coeff, diff_stride, tx_type);
}
static void highbd_fwd_txfm_8x16(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt, const int bd) {
(void) fwd_txfm_opt;
(void) bd;
(void)fwd_txfm_opt;
(void)bd;
vp10_highbd_fht8x16(src_diff, coeff, diff_stride, tx_type);
}
static void highbd_fwd_txfm_16x8(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt, const int bd) {
(void) fwd_txfm_opt;
(void) bd;
(void)fwd_txfm_opt;
(void)bd;
vp10_highbd_fht16x8(src_diff, coeff, diff_stride, tx_type);
}
static void highbd_fwd_txfm_16x32(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt, const int bd) {
(void) fwd_txfm_opt;
(void) bd;
(void)fwd_txfm_opt;
(void)bd;
vp10_highbd_fht16x32(src_diff, coeff, diff_stride, tx_type);
}
static void highbd_fwd_txfm_32x16(const int16_t *src_diff, tran_low_t *coeff,
int diff_stride, TX_TYPE tx_type,
FWD_TXFM_OPT fwd_txfm_opt, const int bd) {
(void) fwd_txfm_opt;
(void) bd;
(void)fwd_txfm_opt;
(void)bd;
vp10_highbd_fht32x16(src_diff, coeff, diff_stride, tx_type);
}
#endif // CONFIG_EXT_TX
......@@ -473,29 +473,26 @@ void highbd_fwd_txfm(const int16_t *src_diff, tran_low_t *coeff,
bd);
break;
case TX_8X16:
highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, tx_type,
fwd_txfm_opt, bd);
highbd_fwd_txfm_8x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt,
bd);
break;
case TX_16X8:
highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, tx_type,
fwd_txfm_opt, bd);
highbd_fwd_txfm_16x8(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt,
bd);
break;
case TX_16X32:
highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, tx_type,
fwd_txfm_opt, bd);
highbd_fwd_txfm_16x32(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt,
bd);
break;
case TX_32X16:
highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, tx_type,
fwd_txfm_opt, bd);
highbd_fwd_txfm_32x16(src_diff, coeff, diff_stride, tx_type, fwd_txfm_opt,
bd);
break;
#endif // CONFIG_EXT_TX
case TX_4X4:
highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type,
lossless, bd);
break;
default:
assert(0);
highbd_fwd_txfm_4x4(src_diff, coeff, diff_stride, tx_type, lossless, bd);
break;
default: assert(0); break;
}
}
#endif // CONFIG_VP9_HIGHBITDEPTH
......@@ -18,64 +18,62 @@
#include "vpx/vpx_integer.h"
static double compute_dist(int16_t *x, int xstride, int16_t *y, int ystride,
int nhb, int nvb, int coeff_shift) {
int nhb, int nvb, int coeff_shift) {
int i, j;
double sum;
sum = 0;
for (i = 0; i < nvb << 3; i++) {
for (j = 0; j < nhb << 3; j++) {
double tmp;
tmp = x[i*xstride + j] - y[i*ystride + j];
sum += tmp*tmp;
tmp = x[i * xstride + j] - y[i * ystride + j];
sum += tmp * tmp;
}
}
return sum/(double)(1 << 2*coeff_shift);
return sum / (double)(1 << 2 * coeff_shift);
}
int vp10_dering_search(YV12_BUFFER_CONFIG *frame, const YV12_BUFFER_CONFIG *ref,
VP10_COMMON *cm,
MACROBLOCKD *xd) {
VP10_COMMON *cm, MACROBLOCKD *xd) {
int r, c;
int sbr, sbc;
int nhsb, nvsb;
od_dering_in *src;
int16_t *ref_coeff;
unsigned char *bskip;
int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS] = {{0}};
int dir[OD_DERING_NBLOCKS][OD_DERING_NBLOCKS] = { { 0 } };
int stride;
int bsize