Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Tomas Härdin" <tjoppen@acc.umu.se>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/jpeg2000: Add support for High-Throughput JPEG 2000 (HTJ2K) decoding.
Date: Thu, 22 Sep 2022 11:15:41 +0200
Message-ID: <7f5d0fc9c799e86edfe11d82ad282c7832f7ffec.camel@acc.umu.se> (raw)
In-Reply-To: <CAF7=sGLuTt2Pwi-bJwjnZ8fpA=3pTA+VD7syF=Mt=qRfQeDYFQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]

tor 2022-09-22 klockan 07:07 +0300 skrev Caleb Etemesi:
> There is one with way better performance on its way, especially with
> images
> with magnitude refinement passes.
> 
> here @https://github.com/etemesi254/FFmpeg/tree/my-profile
> 
> And the associated runtime profile from running
> 
> `perf record -g -F 999 ./ffmpeg_g  -i ~/jpeg2000/meridian.ht.j2c  -v
> 32
>  -bench
> mark -f null  -`
> 
> Online version  - https://share.firefox.dev/3C0rI9e
> 
> Image -
> https://etemesi254.github.io/assets/imgs/gsoc/meridian.ht.j2c [ 4K
> image]
> 
> Ffmpeg results from the benchmark
> 
> `
> bench: utime=0.371s stime=0.036s rtime=0.408s
> bench: maxrss=165900kB
> `
> The machine is an AMD Ryzen 6000U with 6 cores 128kb L1.
> 
> Perf reports it takes 826 ms,  because the decoder does two decodes
> per
> image,(I think one for the demuxer then the decoder, probably a bug).
> anf most of the time is spent on idwt

Yeah this is due to the way probing in lavf works. When I did
development on the Part 1 decoder I dummied out the first decode, which
always runs at full resolution btw, regardless of what -lowres is set
to.

Have you tested your patch with YUV samples or only RGB? For lossless
RGB it seems to work fine, even when roundtripping back through
OpenJPH. That is, using your decoder on files encoded losslessly with
OpenJPH and then encoding with OpenJPH again yields the exact same
bitstream (except the version number of OpenJPH in the header, 0.7.3 vs
0.9.0 for my samples)

I'm currently trying to convert one of SVT's open samples from Part 1
to Part 15, but unfortunately either OpenJPH isn't writing the right
metadata to say that is it YUV or your code is not probing the pixel
format correctly:

ftp://svtopencontent.svt.se/pub/svt_videotestsuite_natural_complexity/REC709/smoke_sauna_JPEG2000_SDR_3840x2160p50_YUV444_12bit_Lossless.mov

ffmpeg -i
smoke_sauna_JPEG2000_HDR_REC2100_3840x2160p50_YUV444_12bit_Lossless.mov
-vframes 1 sauna-yuv444p12le.yuv
ojph_compress -reversible true -dims '{3840,2160}' -num_comps 3 -signed
false -bit_depth 12 -downsamp '{1,1}' -i sauna-yuv444p12le.yuv -o
sauna.jph

Input vs output:
  Stream #0:0[0x1]: Video: jpeg2000 (JPEG 2000 codestream restriction
0) (mjp2 / 0x32706A6D), yuv444p12le(bt2020nc/bt2020/smpte2084,
progressive), 3840x2160, lossless, 5543461 kb/s, SAR 1:1 DAR 16:9, 50
fps, 50 tbr, 12800 tbn (default)
  Stream #0:0: Video: jpeg2000, rgb48le(12 bpc), 3840x2160, lossless,
25 fps, 25 tbr, 25 tbn

Transcoding the .jph to .png 

I have attached the first 64k of sauna.jph for everyone's sleuthing
benefits. I decoded, downscaled and encoded it to jpeg, see attachment.
It is what you'd expect when YUV is mistaken for RGB.

Your decoder doesn't seem to like partial files btw.

/Tomas

[-- Attachment #2: sauna-cut.jph --]
[-- Type: image/x-jp2-codestream, Size: 65536 bytes --]

[-- Attachment #3: sauna.jpg --]
[-- Type: image/jpeg, Size: 69545 bytes --]

[-- Attachment #4: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2022-09-22  9:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 20:49 etemesicaleb
2022-09-09 15:46 ` Michael Niedermayer
2022-09-09 16:52   ` Caleb Etemesi
2022-09-09 17:11     ` Caleb Etemesi
2022-09-09 21:34       ` Andreas Rheinhardt
2022-09-10  9:13         ` Caleb Etemesi
2022-09-20 13:49 ` Tomas Härdin
2022-09-21  8:13   ` Caleb Etemesi
2022-09-21 10:30     ` Tomas Härdin
2022-09-21 14:08       ` Tomas Härdin
2022-09-22  4:07         ` Caleb Etemesi
2022-09-22  9:15           ` Tomas Härdin [this message]
2022-09-22 16:16             ` Caleb Etemesi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f5d0fc9c799e86edfe11d82ad282c7832f7ffec.camel@acc.umu.se \
    --to=tjoppen@acc.umu.se \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git