Skip to content
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

Change define output_bit_depth #1411

Closed
wants to merge 1 commit into from
Closed

Conversation

Jamaika1
Copy link
Contributor

No description provided.

Copy link
Contributor

@bradh bradh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or uncompressed, or JPEG 2000, or....

This seems like a bad idea. Potentially the codec could have a default bit depth option.

@Jamaika1
Copy link
Contributor Author

Jamaika1 commented Nov 25, 2024

Currently default is 10bit. Adds 8bit tiff/png/jpeg and outputs 10bit with errors.

heifenc_10bit_avx.exe image_24bit.png --verbose -q 100 --vvc -e vvenc --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_10bit.vvic
--- construct_pipeline
from: colorspace=RGB chroma=RGB bpp(R)=8 alpha=no
to: colorspace=YCbCr chroma=420 bpp(R)=8 alpha=no matrix-coefficients=6 colour-primaries=1 transfer-characteristics=13 full-range=no <--Why is output 8bit?

heifenc_08bit_avx.exe image_24bit.png --verbose -q 100 --vvc -e vvenc --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_8bit.vvic
--- construct_pipeline
from: colorspace=RGB chroma=RGB bpp(R)=8 alpha=no
to: colorspace=YCbCr chroma=420 bpp(R)=8 alpha=no matrix-coefficients=6 colour-primaries=1 transfer-characteristics=13 full-range=no <--Why? VVenc doesn't have 8bit output

I am missing verbose info vvenc

heifenc_10bit_avx.exe image_48bit.png --verbose -q 100 --vvc -e vvenc --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_10bit.vvic
--- construct_pipeline
from: colorspace=RGB chroma=RRGGBBB_LE bpp(R)=10 alpha=no
to: colorspace=YCbCr chroma=420 bpp(R)=10 alpha=no matrix-coefficients=6 colour-primaries=1 transfer-characteristics=13 full-range=no
final pipeline has 3 steps:
> 27Op_RRGGBBaa_swap_endianness
> 25Op_RRGGBBaa_BE_to_RGB_HDR
> 15Op_RGB_to_YCbCrItE
input spec: colorspace=RGB chroma=RRGGBBB_LE bpp(interleaved)=10
input spec: colorspace=RGB chroma=RRGGBB_BE bpp(interleaved)=10
input spec: colorspace=RGB chroma=444 bpp(R)=10
Could not encode HEIF/AVIF file: Encoder plugin generated an error: Unsupported image type: Bit depth not supported by vvenc < Why?

I don't want yuv444p.

@farindk
Copy link
Contributor

farindk commented Nov 25, 2024

I agree that this change is no good idea, it's changing the default depending on whether some codecs are available even if the user does not use them. Gets us very close to undefined behavior.

However, what we probably need is a way to query the plugins for the supported bit depths and output an error when it is not supported or provide a fallback.

@Jamaika1
Copy link
Contributor Author

Jamaika1 commented Nov 25, 2024

Or uncompressed, or JPEG 2000, or....

This seems like a bad idea. Potentially the codec could have a default bit depth option.

I don't understand the suggestion but know that codecs will have new features.
Test jpeg2000
heifenc_08bit_avx.exe image_21447_24bit.png --verbose --jpeg2000 -L -q 100 -e openjpeg --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_jpeg2000_08.heif
heifenc_08bit_avx.exe image_21447_24bit.png --verbose --htj2k -L -q 100 -e openjph --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_htj2k_08.heif
heifenc_10bit_avx.exe image_21447_48bit.png --verbose --jpeg2000 -L -q 100 -e openjpeg --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_jpeg2000_10.heif
heifenc_10bit_avx.exe image_21447_48bit.png --verbose --htj2k -L -q 100 -e openjph --no-alpha --matrix_coefficients=6 --full_range_flag=0 -o image_htj2k_10.heif
https://www.sendspace.com/file/n6idh9
Out of curiosity I did a lossless conversion heic jpeg 2000 to jpeg 2000.
For 8bit even jpeg2000 shows something. I would even say correctly.
For 10bit it is not so good.

I don't know why there are such significant differences in file sizes for jpeg2000 and openjph.
I admit that my openjph is old because didn`t have time.

@Jamaika1 Jamaika1 closed this Nov 26, 2024
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.

3 participants