* [FFmpeg-devel] [PATCH v2 0/1] avcodec/libjxlenc: add option to disable xyb encoding
@ 2024-02-11 17:03 Leo Izen
2024-02-11 17:03 ` [FFmpeg-devel] [PATCH v2 1/1] " Leo Izen
0 siblings, 1 reply; 2+ messages in thread
From: Leo Izen @ 2024-02-11 17:03 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Leo Izen
Changes since v1:
- bump micro version, per policy
- rebase onto master
Leo Izen (1):
avcodec/libjxlenc: add option to disable xyb encoding
libavcodec/libjxlenc.c | 5 ++++-
libavcodec/version.h | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
--
2.43.0
_______________________________________________
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* [FFmpeg-devel] [PATCH v2 1/1] avcodec/libjxlenc: add option to disable xyb encoding
2024-02-11 17:03 [FFmpeg-devel] [PATCH v2 0/1] avcodec/libjxlenc: add option to disable xyb encoding Leo Izen
@ 2024-02-11 17:03 ` Leo Izen
0 siblings, 0 replies; 2+ messages in thread
From: Leo Izen @ 2024-02-11 17:03 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Leo Izen
Add an AVOption to the libjxl encoder wrapper, which exposes the flag
uses_original_profile in libjxl. For highly unusual ICC profiles where
the target needs to stay in the original space, this can be useful.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
---
libavcodec/libjxlenc.c | 5 ++++-
libavcodec/version.h | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/libjxlenc.c b/libavcodec/libjxlenc.c
index 5f5f9751dc..3f2c74097d 100644
--- a/libavcodec/libjxlenc.c
+++ b/libavcodec/libjxlenc.c
@@ -52,6 +52,7 @@ typedef struct LibJxlEncodeContext {
int effort;
float distance;
int modular;
+ int xyb;
uint8_t *buffer;
size_t buffer_size;
} LibJxlEncodeContext;
@@ -303,7 +304,7 @@ static int libjxl_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFra
av_log(avctx, AV_LOG_WARNING, "Unknown color range, assuming full (pc)\n");
/* bitexact lossless requires there to be no XYB transform */
- info.uses_original_profile = ctx->distance == 0.0;
+ info.uses_original_profile = ctx->distance == 0.0 || !ctx->xyb;
info.orientation = frame->linesize[0] >= 0 ? JXL_ORIENT_IDENTITY : JXL_ORIENT_FLIP_VERTICAL;
if (JxlEncoderSetBasicInfo(ctx->encoder, &info) != JXL_ENC_SUCCESS) {
@@ -474,6 +475,8 @@ static const AVOption libjxl_encode_options[] = {
{ "distance", "Maximum Butteraugli distance (quality setting, "
"lower = better, zero = lossless, default 1.0)", OFFSET(distance), AV_OPT_TYPE_FLOAT, { .dbl = -1.0 }, -1.0, 15.0, VE },
{ "modular", "Force modular mode", OFFSET(modular), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+ { "xyb", "Use XYB-encoding for lossy images", OFFSET(xyb),
+ AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ NULL },
};
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f2f14eaed1..ecdbc51c74 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
#include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 39
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
--
2.43.0
_______________________________________________
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".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-11 17:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-11 17:03 [FFmpeg-devel] [PATCH v2 0/1] avcodec/libjxlenc: add option to disable xyb encoding Leo Izen
2024-02-11 17:03 ` [FFmpeg-devel] [PATCH v2 1/1] " Leo Izen
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