Commit 5e540ea3 authored by Yaowu Xu's avatar Yaowu Xu

Add aom_ prefix to psnr functions

ported from libvpx/nextgenv2: 38cfc45e

Change-Id: Ie13ba93289db13137aca8a0acd515e962671f18b
parent 59f70766
...@@ -198,9 +198,9 @@ int64_t aom_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a, ...@@ -198,9 +198,9 @@ int64_t aom_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
a->y_crop_width, a->y_crop_height); a->y_crop_width, a->y_crop_height);
} }
void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b, void aom_calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
PSNR_STATS *psnr, unsigned int bit_depth, const YV12_BUFFER_CONFIG *b, PSNR_STATS *psnr,
unsigned int in_bit_depth) { uint32_t bit_depth, uint32_t in_bit_depth) {
const int widths[3] = {a->y_crop_width, a->uv_crop_width, a->uv_crop_width}; const int widths[3] = {a->y_crop_width, a->uv_crop_width, a->uv_crop_width};
const int heights[3] = {a->y_crop_height, a->uv_crop_height, const int heights[3] = {a->y_crop_height, a->uv_crop_height,
a->uv_crop_height}; a->uv_crop_height};
...@@ -246,8 +246,8 @@ void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b, ...@@ -246,8 +246,8 @@ void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
#endif #endif
void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b, void aom_calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
PSNR_STATS *psnr) { PSNR_STATS *psnr) {
static const double peak = 255.0; static const double peak = 255.0;
const int widths[3] = {a->y_crop_width, a->uv_crop_width, a->uv_crop_width}; const int widths[3] = {a->y_crop_width, a->uv_crop_width, a->uv_crop_width};
const int heights[3] = {a->y_crop_height, a->uv_crop_height, const int heights[3] = {a->y_crop_height, a->uv_crop_height,
......
...@@ -36,25 +36,21 @@ typedef struct { ...@@ -36,25 +36,21 @@ typedef struct {
*/ */
double aom_sse_to_psnr(double samples, double peak, double sse); double aom_sse_to_psnr(double samples, double peak, double sse);
int64_t aom_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b); int64_t aom_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b);
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_HIGHBITDEPTH
int64_t aom_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a, int64_t aom_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
const YV12_BUFFER_CONFIG *b); const YV12_BUFFER_CONFIG *b);
void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
PSNR_STATS *psnr, unsigned int bit_depth, void aom_calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
unsigned int in_bit_depth); const YV12_BUFFER_CONFIG *b, PSNR_STATS *psnr,
int64_t highbd_get_sse_shift(const uint8_t *a8, int a_stride, const uint8_t *b8, unsigned int bit_depth, unsigned int in_bit_depth);
int b_stride, int width, int height,
unsigned int input_shift);
#endif #endif
void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b, void aom_calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
PSNR_STATS *psnr); PSNR_STATS *psnr);
double aom_psnrhvs(const YV12_BUFFER_CONFIG *source, double aom_psnrhvs(const YV12_BUFFER_CONFIG *source,
const YV12_BUFFER_CONFIG *dest, double *phvs_y, const YV12_BUFFER_CONFIG *dest, double *phvs_y,
double *phvs_u, double *phvs_v, uint32_t bd, uint32_t in_bd); double *phvs_u, double *phvs_v, uint32_t bd, uint32_t in_bd);
int64_t highbd_get_sse(const uint8_t *a, int a_stride, const uint8_t *b,
int b_stride, int width, int height);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
......
...@@ -1856,10 +1856,10 @@ static void generate_psnr_packet(AV1_COMP *cpi) { ...@@ -1856,10 +1856,10 @@ static void generate_psnr_packet(AV1_COMP *cpi) {
int i; int i;
PSNR_STATS psnr; PSNR_STATS psnr;
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_HIGHBITDEPTH
calc_highbd_psnr(cpi->Source, cpi->common.frame_to_show, &psnr, aom_calc_highbd_psnr(cpi->Source, cpi->common.frame_to_show, &psnr,
cpi->td.mb.e_mbd.bd, cpi->oxcf.input_bit_depth); cpi->td.mb.e_mbd.bd, cpi->oxcf.input_bit_depth);
#else #else
calc_psnr(cpi->Source, cpi->common.frame_to_show, &psnr); aom_calc_psnr(cpi->Source, cpi->common.frame_to_show, &psnr);
#endif #endif
for (i = 0; i < 4; ++i) { for (i = 0; i < 4; ++i) {
...@@ -3538,9 +3538,9 @@ static void compute_internal_stats(AV1_COMP *cpi) { ...@@ -3538,9 +3538,9 @@ static void compute_internal_stats(AV1_COMP *cpi) {
aom_clear_system_state(); aom_clear_system_state();
// TODO(yaowu): unify these two versions into one. // TODO(yaowu): unify these two versions into one.
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_HIGHBITDEPTH
calc_highbd_psnr(orig, recon, &psnr, cpi->td.mb.e_mbd.bd, in_bit_depth); aom_calc_highbd_psnr(orig, recon, &psnr, bit_depth, in_bit_depth);
#else #else
calc_psnr(orig, recon, &psnr); aom_calc_psnr(orig, recon, &psnr);
#endif // CONFIG_AOM_HIGHBITDEPTH #endif // CONFIG_AOM_HIGHBITDEPTH
adjust_image_stat(psnr.psnr[1], psnr.psnr[2], psnr.psnr[3], psnr.psnr[0], adjust_image_stat(psnr.psnr[1], psnr.psnr[2], psnr.psnr[3], psnr.psnr[0],
......
...@@ -37,14 +37,14 @@ double compute_hbd_psnr(const YV12_BUFFER_CONFIG *source, ...@@ -37,14 +37,14 @@ double compute_hbd_psnr(const YV12_BUFFER_CONFIG *source,
const YV12_BUFFER_CONFIG *dest, uint32_t in_bd, const YV12_BUFFER_CONFIG *dest, uint32_t in_bd,
uint32_t bd) { uint32_t bd) {
PSNR_STATS psnr; PSNR_STATS psnr;
calc_highbd_psnr(source, dest, &psnr, bd, in_bd); aom_calc_highbd_psnr(source, dest, &psnr, bd, in_bd);
return psnr.psnr[0]; return psnr.psnr[0];
} }
double compute_psnr(const YV12_BUFFER_CONFIG *source, double compute_psnr(const YV12_BUFFER_CONFIG *source,
const YV12_BUFFER_CONFIG *dest) { const YV12_BUFFER_CONFIG *dest) {
PSNR_STATS psnr; PSNR_STATS psnr;
calc_psnr(source, dest, &psnr); aom_calc_psnr(source, dest, &psnr);
return psnr.psnr[0]; return psnr.psnr[0];
} }
......
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