mån 2024-01-29 klockan 19:37 -0500 skrev Leo Izen:
> libjxl doesn't support negative strides, but JPEG XL has an
> orientation
> flag inside the codestream. We can use this to work around the
> library
> limitation, by taking the absolute value of the negative row stride,
> sending the image up-side-down, and telling the library that the
> image
> has a vertical-flip orientation.

Coincidentally we were just talking about negative stride on IRC
yesterday.

>      jxl_fmt.endianness = JXL_NATIVE_ENDIAN;
> -    jxl_fmt.align = frame->linesize[0];
> +    if (frame->linesize[0] >= 0) {
> +        jxl_fmt.align = frame->linesize[0];
> +        data = frame->data[0];
> +    } else {
> +        jxl_fmt.align = -frame->linesize[0];
> +        data = frame->data[0] - jxl_fmt.align * (info.ysize - 1);

Looks correct

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

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

Reply via email to