Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ffa969f9
authored
Apr 17, 2023
by
Googler
Committed by
Rohit Singh
Apr 18, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Expose MssimCaluclator for use in Duetdev tests
Child: <unknown commit> PiperOrigin-RevId: 524876651
parent
6f4fca8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
libraries/transformer/src/main/java/androidx/media3/transformer/MssimCalculator.java
libraries/transformer/src/main/java/androidx/media3/transformer/MssimCalculator.java
View file @
ffa969f9
...
@@ -17,6 +17,8 @@ package androidx.media3.transformer;
...
@@ -17,6 +17,8 @@ package androidx.media3.transformer;
import
static
java
.
lang
.
Math
.
pow
;
import
static
java
.
lang
.
Math
.
pow
;
import
androidx.media3.common.util.UnstableApi
;
/**
/**
* Image comparison tool that calculates the Mean Structural Similarity (MSSIM) of two images,
* Image comparison tool that calculates the Mean Structural Similarity (MSSIM) of two images,
* developed by Wang, Bovik, Sheikh, and Simoncelli.
* developed by Wang, Bovik, Sheikh, and Simoncelli.
...
@@ -25,7 +27,8 @@ import static java.lang.Math.pow;
...
@@ -25,7 +27,8 @@ import static java.lang.Math.pow;
*
*
* <p>See <a href=https://ece.uwaterloo.ca/~z70wang/publications/ssim.pdf>the SSIM paper</a>.
* <p>See <a href=https://ece.uwaterloo.ca/~z70wang/publications/ssim.pdf>the SSIM paper</a>.
*/
*/
/* package */
final
class
MssimCalculator
{
@UnstableApi
public
final
class
MssimCalculator
{
// Referred to as 'L' in the SSIM paper, this constant defines the maximum pixel values. The
// Referred to as 'L' in the SSIM paper, this constant defines the maximum pixel values. The
// range of pixel values is 0 to 255 (8 bit unsigned range).
// range of pixel values is 0 to 255 (8 bit unsigned range).
private
static
final
int
PIXEL_MAX_VALUE
=
255
;
private
static
final
int
PIXEL_MAX_VALUE
=
255
;
...
@@ -47,7 +50,7 @@ import static java.lang.Math.pow;
...
@@ -47,7 +50,7 @@ import static java.lang.Math.pow;
/**
/**
* Calculates the Mean Structural Similarity (MSSIM) between two images with window skipping.
* Calculates the Mean Structural Similarity (MSSIM) between two images with window skipping.
*
*
* @see #calculate(byte[], byte[], int, int, boolean)
.
* @see #calculate(byte[], byte[], int, int, boolean)
*/
*/
public
static
double
calculate
(
public
static
double
calculate
(
byte
[]
referenceBuffer
,
byte
[]
distortedBuffer
,
int
width
,
int
height
)
{
byte
[]
referenceBuffer
,
byte
[]
distortedBuffer
,
int
width
,
int
height
)
{
...
...
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