-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Error in encoding big images with CTU size 16 #1161
Comments
I can reproduce. However the problem is not in libheif, or in the x265 plugin. You can reproduce this problem with x265 on the command line.
I don't have a solution right now, but would suggest you can work out an appropriate set of options using In any case, I don't think this is an issue in libheif. |
Thank you @bradh.
Right, I have read that level 5 (automatically detected) does not support ctu=16.
I found the x265 flag `--allow-non-conformance` to bypass the problem. So far, this is enough for me, because it seems that the decoders in libheif and in my system are not strict, so they accept the compressed image and decode it successfully.
```
x265 --ctu=16 --allow-non-conformance man4.y4m out.bits
```
or
```
heif-enc -p x265:ctu=16 -p x265:allow-non-conformance=1 man4.jpg man4_ctu16.heic
```
However, I'll read the specification and see if I can find a conformant solution.
…On 4/13/24 3:15 AM, Brad Hards ***@***.***> wrote:
I can reproduce. However the problem is not in libheif, or in the x265
plugin.
You can reproduce this problem with x265 on the command line.
|x265 --ctu=16 man4.y4m out.bits y4m [info]: 2048x2048 fps 25/1 i420p8
sar 1:1 frames 0 - 0 of 1 raw [info]: output file: out.bits x265 [info]:
HEVC encoder version 3.5+1-f0c1022b6 x265 [info]: build info [Linux][GCC
11.2.0][64 bit] 8bit+10bit+12bit x265 [info]: using cpu capabilities:
MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 x265 [warning]: Max
TU size should be less than or equal to max CU size, setting max TU size
= 16 x265 [warning]: QGSize should be less than or equal to maxCUSize,
setting QGSize = 16 x265 [warning]: level 5 detected, but CTU size 16 is
non-compliant x265 [info]: NONE profile, Level-NONE (Main tier) x265
[info]: non-conformant bitstreams not allowed (--allow-non-conformance)
x265 [error]: x265_encoder_open() failed for Enc, x265 [error]: Failure
generating stream headers in x265 |
I don't have a solution right now, but would suggest you can work out an
appropriate set of options using |x265| (and probably the HEVC encoder
specifications, e.g. ISO/IEC 23008-2) to find the options you need.
In any case, I don't think this is an issue in libheif.
—
Reply to this email directly, view it on GitHub
<#1161 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGEVAST5LD54ZCJL226OXHDY5B2JBAVCNFSM6AAAAABGEK7DFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJSG4YTSOBTGM>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The x265 command line docs says that the default maximum TU size is 32. If you set CTU to 16, this combination makes no sense as the TU has to be smaller or equal to CTU. My guess is that if you set BTW: any reason for reducing the CTU size? It should just lower the compression ratio. |
If I set
but it still results in errors because of a non-conformant bitstream. It happens similarly if I also add
I am experimenting with a custom inloop filter, I would like to see how it behaves at different CTU sizes. |
Hello,
I am using libheif to encode large images via x265 encoder. I am interested in testing the smallest CTU size (16).
I receive the
Invalid Image size
error. For squared images with size HxH, this happens for H>1488.For convenience, we can reproduce the error using
heif-enc
on a 2048x2048 test image:It works fine with a smaller image, e.g. 1024x1024, or with higher
ctu
:It seems to be independent on the image content, at least with the samples I have tried.
I am using libheif v1.17.6 and x265 v3.5.
test_images.zip
The text was updated successfully, but these errors were encountered: