Skip to content

Allow MSE and peak error testing against source images #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

palemieux
Copy link
Contributor

@palemieux palemieux commented Dec 6, 2024

c1p1_04-0.j2c must be added to fate-suite\jpeg2000\itu-iso\codestreams_profile1

c1p1_04-0.zip

@osamu620
Copy link
Collaborator

Assuming the patch that fixes UBSAN, I got another UBSAN.

libavcodec/bytestream.h:171:15: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavcodec/bytestream.h:171:15 in
./tests/fate-run.sh: line 119: 77325 Abort trap: 6           $target_exec $target_path/"$@"
threads=1

for p1_02 and p1_03.

@osamu620
Copy link
Collaborator

I have tested the patch on a 32-bit environment. I got the following error.

--- ./tests/ref/fate/jpeg2000dec-ds1_ht_04_b9   2024-12-17 13:20:53.163749915 +0900
+++ tests/data/fate/jpeg2000dec-ds1_ht_04_b9    2024-12-17 13:21:13.619869688 +0900
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 1024x1024
 #sar 0: 0/1
-0,          0,          0,        1,  2097152, 0x9df478aa
+0,          0,          0,        1,  2097152, 0x5b4dd999
Test jpeg2000dec-ds1_ht_04_b9 failed. Look at tests/data/fate/jpeg2000dec-ds1_ht_04_b9.err for details.
make: [tests/Makefile:311: fate-jpeg2000dec-ds1_ht_04_b9] Error 1 (ignored)

@palemieux
Copy link
Contributor Author

Can you run just this one:

fate-jpeg2000dec-p1_04

@osamu620
Copy link
Collaborator

osamu620 commented Dec 17, 2024

Can you run just this one:

fate-jpeg2000dec-p1_04

Looks good (No error was generated). Do you know the reason?

@palemieux
Copy link
Contributor Author

I implemented the MSE and peak error comparison only for that one! Look at the make file.

@palemieux palemieux force-pushed the patches/update-fate branch from 58cd569 to 3d4a0c0 Compare January 22, 2025 01:43
@osamu620
Copy link
Collaborator

Where can I see the thresholds for the lossy codestreams?

Cosmetic change in preparation for the next commit.

Signed-off-by: James Almer <[email protected]>
…upported but conversion is not required

Values in csp, prim, trc, etc, are irrelevant if there's no conversion needed.

Reviewed-by: Niklas Haas <[email protected]>
Signed-off-by: James Almer <[email protected]>
@palemieux
Copy link
Contributor Author

Where can I see the thresholds for the lossy codestreams?

Look at line 72 at tests/fate/jpeg2000.mak

sunyuechi and others added 19 commits January 25, 2025 09:37
Signed-off-by: Rémi Denis-Courmont <[email protected]>
Make the checker functions available for all codecs.

Signed-off-by: Marton Balint <[email protected]>
The comments supposed to track the possible value of the qmat and qmat16
matrices, but they were not updated properly in the long history of the
mpegvideo encoder. Also they wrongly assumed the usage of built-in quantizer
matrices and linear quantization.

Signed-off-by: Marton Balint <[email protected]>
…is_c and dct_quantize_c

Fixes corruption with:

ffmpeg -t 1 -filter_complex "sine=f=21,showwaves=scale=cbrt:mode=line:colors=white:draw=full" -c:v mpeg2video -non_linear_quant 1 -qmin 1 -qmax 1 -cpuflags 0 out.mpg

or

ffmpeg -t 1 -filter_complex "sine=f=21,showwaves=scale=cbrt:mode=line:colors=white:draw=full" -c:v mpeg2video -non_linear_quant 1 -qmin 1 -qmax 1 -trellis 1 out.mpg

Signed-off-by: Marton Balint <[email protected]>
…nfigurations

This was disabled in da60b99 and then
accidentally re-enabled in 172b0e2.

The code in question was never properly adapted for litte-endian mode.

refs: trac/10955
Signed-off-by: Michael Niedermayer <[email protected]>
codec37 operates on 2 buffers, which must be considered private to
the codec and must therefore not be changed by subsequent FOBJs.

Let codec37 therefore operate on frm1/2 instead of frm0/2, but copy
the decoded image to frm0 where other codecs operate on.

Fixes artifacts encountered in Full Throttle "dazed.san" and also
in a lot of Rebel Assault II gameplay videos: these videos consist of
frames with an initial codec37 FOBJ image to set the stage, and
optional codec1-23 FOBJs overlaid on top of that image.

Signed-off-by: Manuel Lauss <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
…xtension_picky mode"

The next commit implements the hls fix in a way that doesnt need this

This reverts commit 54897da.
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
mpegts is treated independent of the extension

It is recommended to set the whitelists correctly
instead of depending on extensions, but this should help a bit,
and this is easier to backport

Fixes: CVE-2023-6602 II. HLS Force TTY Demuxer
Fixes: CVE-2023-6602 IV. HLS XBIN Demuxer DoS Amplification

The other parts of CVE-2023-6602 have been fixed by prior commits

Found-by: Harvey Phillips of Amazon Element55 (element55)
Signed-off-by: Michael Niedermayer <[email protected]>
This will be used to propagate global side data through the filterchain.

Signed-off-by: James Almer <[email protected]>
This will be used to propagate global side data through the filterchain.

Signed-off-by: James Almer <[email protected]>
This will be used to get global side data that was propagated through the
filterchain.

Signed-off-by: James Almer <[email protected]>
…he filterchain

Global side data as exported by a decoder may no longer apply if a filter in
the chain altered the frames in some form, like changing color, dimensions,
or channel layout information.
After this change, any such changes in side data will be taken into account by
the encoder futher in the process.

Signed-off-by: James Almer <[email protected]>
@palemieux palemieux force-pushed the patches/update-fate branch from 3d4a0c0 to 66fe0eb Compare January 26, 2025 23:06
@osamu620
Copy link
Collaborator

On 32-bit machine, I got the following:

❯ make -j12 fate-jpeg2000dec-p1_04 SAMPLES=../fate-suite/
TEST    jpeg2000dec-p1_04
--- ./tests/ref/fate/jpeg2000dec-p1_04  2025-01-30 14:40:11.111460431 +0900
+++ tests/data/fate/jpeg2000dec-p1_04   2025-01-30 14:51:30.515668440 +0900
@@ -1,2 +1,2 @@
 psnr_log_version:3 fields:n,mse_avg,mse_y,psnr_avg,psnr_y,max_avg,max_y,peak_y
-n:1 mse_avg:14434.96 mse_y:14434.96 psnr_avg:54.74 psnr_y:54.74 max_avg:65535 max_y:65535 peak_y:4048
+n:1 mse_avg:14435.37 mse_y:14435.37 psnr_avg:54.74 psnr_y:54.74 max_avg:65535 max_y:65535 peak_y:4048
Test jpeg2000dec-p1_04 failed. Look at tests/data/fate/jpeg2000dec-p1_04.err for details.
make: *** [tests/Makefile:311: fate-jpeg2000dec-p1_04] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants