Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
38cfc45e
Commit
38cfc45e
authored
Feb 22, 2016
by
Yaowu Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup psnr.h
Change-Id: Id026e72ee655ee5bd645a89e378da0d462be367d
parent
d1c5cd4a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
38 deletions
+30
-38
test/hbd_metrics_test.cc
test/hbd_metrics_test.cc
+2
-2
vp10/encoder/encoder.c
vp10/encoder/encoder.c
+5
-5
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.c
+8
-8
vpx_dsp/psnr.c
vpx_dsp/psnr.c
+13
-14
vpx_dsp/psnr.h
vpx_dsp/psnr.h
+2
-9
No files found.
test/hbd_metrics_test.cc
View file @
38cfc45e
...
@@ -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
,
const
YV12_BUFFER_CONFIG
*
dest
,
uint32_t
in_bd
,
uint32_t
bd
)
{
uint32_t
in_bd
,
uint32_t
bd
)
{
PSNR_STATS
psnr
;
PSNR_STATS
psnr
;
calc_highbd_psnr
(
source
,
dest
,
&
psnr
,
bd
,
in_bd
);
vpx_
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
);
vpx_
calc_psnr
(
source
,
dest
,
&
psnr
);
return
psnr
.
psnr
[
0
];
return
psnr
.
psnr
[
0
];
}
}
...
...
vp10/encoder/encoder.c
View file @
38cfc45e
...
@@ -2039,10 +2039,10 @@ static void generate_psnr_packet(VP10_COMP *cpi) {
...
@@ -2039,10 +2039,10 @@ static void generate_psnr_packet(VP10_COMP *cpi) {
int
i
;
int
i
;
PSNR_STATS
psnr
;
PSNR_STATS
psnr
;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
calc_highbd_psnr
(
cpi
->
Source
,
cpi
->
common
.
frame_to_show
,
&
psnr
,
vpx_
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
);
vpx_
calc_psnr
(
cpi
->
Source
,
cpi
->
common
.
frame_to_show
,
&
psnr
);
#endif
#endif
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
i
=
0
;
i
<
4
;
++
i
)
{
...
@@ -3938,9 +3938,9 @@ static void compute_internal_stats(VP10_COMP *cpi) {
...
@@ -3938,9 +3938,9 @@ static void compute_internal_stats(VP10_COMP *cpi) {
vpx_clear_system_state
();
vpx_clear_system_state
();
// TODO(yaowu): unify these two versions into one.
// TODO(yaowu): unify these two versions into one.
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
calc_highbd_psnr
(
orig
,
recon
,
&
psnr
,
cpi
->
td
.
mb
.
e_mbd
.
bd
,
in_bit_depth
);
vpx_calc_highbd_psnr
(
orig
,
recon
,
&
psnr
,
bit_depth
,
in_bit_depth
);
#else
#else
calc_psnr
(
orig
,
recon
,
&
psnr
);
vpx_
calc_psnr
(
orig
,
recon
,
&
psnr
);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VP9_HIGHBITDEPTH
adjust_image_stat
(
psnr
.
psnr
[
1
],
psnr
.
psnr
[
2
],
psnr
.
psnr
[
3
],
adjust_image_stat
(
psnr
.
psnr
[
1
],
psnr
.
psnr
[
2
],
psnr
.
psnr
[
3
],
...
...
vp9/encoder/vp9_encoder.c
View file @
38cfc45e
...
@@ -2145,10 +2145,10 @@ static void generate_psnr_packet(VP9_COMP *cpi) {
...
@@ -2145,10 +2145,10 @@ static void generate_psnr_packet(VP9_COMP *cpi) {
int
i
;
int
i
;
PSNR_STATS
psnr
;
PSNR_STATS
psnr
;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
calc_highbd_psnr
(
cpi
->
Source
,
cpi
->
common
.
frame_to_show
,
&
psnr
,
vpx_
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
);
vpx_
calc_psnr
(
cpi
->
Source
,
cpi
->
common
.
frame_to_show
,
&
psnr
);
#endif
#endif
for
(
i
=
0
;
i
<
4
;
++
i
)
{
for
(
i
=
0
;
i
<
4
;
++
i
)
{
...
@@ -4329,10 +4329,10 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
...
@@ -4329,10 +4329,10 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
YV12_BUFFER_CONFIG
*
pp
=
&
cm
->
post_proc_buffer
;
YV12_BUFFER_CONFIG
*
pp
=
&
cm
->
post_proc_buffer
;
PSNR_STATS
psnr
;
PSNR_STATS
psnr
;
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
calc_highbd_psnr
(
orig
,
recon
,
&
psnr
,
cpi
->
td
.
mb
.
e_mbd
.
bd
,
vpx_
calc_highbd_psnr
(
orig
,
recon
,
&
psnr
,
cpi
->
td
.
mb
.
e_mbd
.
bd
,
in_bit_depth
);
in_bit_depth
);
#else
#else
calc_psnr
(
orig
,
recon
,
&
psnr
);
vpx_
calc_psnr
(
orig
,
recon
,
&
psnr
);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VP9_HIGHBITDEPTH
adjust_image_stat
(
psnr
.
psnr
[
1
],
psnr
.
psnr
[
2
],
psnr
.
psnr
[
3
],
adjust_image_stat
(
psnr
.
psnr
[
1
],
psnr
.
psnr
[
2
],
psnr
.
psnr
[
3
],
...
@@ -4363,10 +4363,10 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
...
@@ -4363,10 +4363,10 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
vpx_clear_system_state
();
vpx_clear_system_state
();
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
calc_highbd_psnr
(
orig
,
pp
,
&
psnr2
,
cpi
->
td
.
mb
.
e_mbd
.
bd
,
vpx_
calc_highbd_psnr
(
orig
,
pp
,
&
psnr2
,
cpi
->
td
.
mb
.
e_mbd
.
bd
,
cpi
->
oxcf
.
input_bit_depth
);
cpi
->
oxcf
.
input_bit_depth
);
#else
#else
calc_psnr
(
orig
,
pp
,
&
psnr2
);
vpx_
calc_psnr
(
orig
,
pp
,
&
psnr2
);
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VP9_HIGHBITDEPTH
cpi
->
totalp_sq_error
+=
psnr2
.
sse
[
0
];
cpi
->
totalp_sq_error
+=
psnr2
.
sse
[
0
];
...
...
vpx_dsp/psnr.c
View file @
38cfc45e
...
@@ -125,10 +125,10 @@ static int64_t get_sse(const uint8_t *a, int a_stride,
...
@@ -125,10 +125,10 @@ static int64_t get_sse(const uint8_t *a, int a_stride,
}
}
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
int64_t
highbd_get_sse_shift
(
const
uint8_t
*
a8
,
int
a_stride
,
static
int64_t
highbd_get_sse_shift
(
const
uint8_t
*
a8
,
int
a_stride
,
const
uint8_t
*
b8
,
int
b_stride
,
const
uint8_t
*
b8
,
int
b_stride
,
int
width
,
int
height
,
int
width
,
int
height
,
unsigned
int
input_shift
)
{
unsigned
int
input_shift
)
{
const
uint16_t
*
a
=
CONVERT_TO_SHORTPTR
(
a8
);
const
uint16_t
*
a
=
CONVERT_TO_SHORTPTR
(
a8
);
const
uint16_t
*
b
=
CONVERT_TO_SHORTPTR
(
b8
);
const
uint16_t
*
b
=
CONVERT_TO_SHORTPTR
(
b8
);
int64_t
total_sse
=
0
;
int64_t
total_sse
=
0
;
...
@@ -145,9 +145,9 @@ int64_t highbd_get_sse_shift(const uint8_t *a8, int a_stride,
...
@@ -145,9 +145,9 @@ int64_t highbd_get_sse_shift(const uint8_t *a8, int a_stride,
return
total_sse
;
return
total_sse
;
}
}
int64_t
highbd_get_sse
(
const
uint8_t
*
a
,
int
a_stride
,
static
int64_t
highbd_get_sse
(
const
uint8_t
*
a
,
int
a_stride
,
const
uint8_t
*
b
,
int
b_stride
,
const
uint8_t
*
b
,
int
b_stride
,
int
width
,
int
height
)
{
int
width
,
int
height
)
{
int64_t
total_sse
=
0
;
int64_t
total_sse
=
0
;
int
x
,
y
;
int
x
,
y
;
const
int
dw
=
width
%
16
;
const
int
dw
=
width
%
16
;
...
@@ -206,11 +206,10 @@ int64_t vpx_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
...
@@ -206,11 +206,10 @@ int64_t vpx_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
void
calc_highbd_psnr
(
const
YV12_BUFFER_CONFIG
*
a
,
void
vpx_calc_highbd_psnr
(
const
YV12_BUFFER_CONFIG
*
a
,
const
YV12_BUFFER_CONFIG
*
b
,
const
YV12_BUFFER_CONFIG
*
b
,
PSNR_STATS
*
psnr
,
PSNR_STATS
*
psnr
,
uint32_t
bit_depth
,
unsigned
int
bit_depth
,
uint32_t
in_bit_depth
)
{
unsigned
int
in_bit_depth
)
{
const
int
widths
[
3
]
=
const
int
widths
[
3
]
=
{
a
->
y_crop_width
,
a
->
uv_crop_width
,
a
->
uv_crop_width
};
{
a
->
y_crop_width
,
a
->
uv_crop_width
,
a
->
uv_crop_width
};
const
int
heights
[
3
]
=
const
int
heights
[
3
]
=
...
@@ -260,8 +259,8 @@ void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
...
@@ -260,8 +259,8 @@ void calc_highbd_psnr(const YV12_BUFFER_CONFIG *a,
#endif // !CONFIG_VP9_HIGHBITDEPTH
#endif // !CONFIG_VP9_HIGHBITDEPTH
void
calc_psnr
(
const
YV12_BUFFER_CONFIG
*
a
,
const
YV12_BUFFER_CONFIG
*
b
,
void
vpx_
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
]
=
{
const
int
widths
[
3
]
=
{
a
->
y_crop_width
,
a
->
uv_crop_width
,
a
->
uv_crop_width
};
a
->
y_crop_width
,
a
->
uv_crop_width
,
a
->
uv_crop_width
};
...
...
vpx_dsp/psnr.h
View file @
38cfc45e
...
@@ -42,17 +42,13 @@ int64_t vpx_get_y_sse(const YV12_BUFFER_CONFIG *a,
...
@@ -42,17 +42,13 @@ int64_t vpx_get_y_sse(const YV12_BUFFER_CONFIG *a,
#if CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
int64_t
vpx_highbd_get_y_sse
(
const
YV12_BUFFER_CONFIG
*
a
,
int64_t
vpx_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
,
void
vpx_
calc_highbd_psnr
(
const
YV12_BUFFER_CONFIG
*
a
,
const
YV12_BUFFER_CONFIG
*
b
,
const
YV12_BUFFER_CONFIG
*
b
,
PSNR_STATS
*
psnr
,
PSNR_STATS
*
psnr
,
unsigned
int
bit_depth
,
unsigned
int
bit_depth
,
unsigned
int
in_bit_depth
);
unsigned
int
in_bit_depth
);
int64_t
highbd_get_sse_shift
(
const
uint8_t
*
a8
,
int
a_stride
,
const
uint8_t
*
b8
,
int
b_stride
,
int
width
,
int
height
,
unsigned
int
input_shift
);
#endif
#endif
void
calc_psnr
(
const
YV12_BUFFER_CONFIG
*
a
,
void
vpx_
calc_psnr
(
const
YV12_BUFFER_CONFIG
*
a
,
const
YV12_BUFFER_CONFIG
*
b
,
const
YV12_BUFFER_CONFIG
*
b
,
PSNR_STATS
*
psnr
);
PSNR_STATS
*
psnr
);
...
@@ -61,9 +57,6 @@ double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
...
@@ -61,9 +57,6 @@ double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
double
*
phvs_y
,
double
*
phvs_u
,
double
*
phvs_y
,
double
*
phvs_u
,
double
*
phvs_v
,
uint32_t
bd
,
uint32_t
in_bd
);
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment