diff options
author | wm4 <wm4@nowhere> | 2015-04-29 21:01:08 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-29 21:01:08 +0200 |
commit | f07c9b16f9c2793605cb8b930095104018379622 (patch) | |
tree | 93787c913661d64312a1c56c33ce2357f1c4ef46 /video | |
parent | 38114b6a36eecae7fa707d4d299ac5622cbe9928 (diff) |
screenshots: add option to disable JPEG 4:4:4 output
That's what it's usually about.
Diffstat (limited to 'video')
-rw-r--r-- | video/image_writer.c | 8 | ||||
-rw-r--r-- | video/image_writer.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/video/image_writer.c b/video/image_writer.c index bcb71f4863..935d4bd962 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -48,6 +48,7 @@ const struct image_writer_opts image_writer_opts_defaults = { .jpeg_optimize = 100, .jpeg_smooth = 0, .jpeg_baseline = 1, + .jpeg_source_chroma = 1, .tag_csp = 1, }; @@ -59,6 +60,7 @@ const struct m_sub_options image_writer_conf = { OPT_INTRANGE("jpeg-optimize", jpeg_optimize, 0, 0, 100), OPT_INTRANGE("jpeg-smooth", jpeg_smooth, 0, 0, 100), OPT_FLAG("jpeg-baseline", jpeg_baseline, 0), + OPT_FLAG("jpeg-source-chroma", jpeg_source_chroma, 0), OPT_INTRANGE("png-compression", png_compression, 0, 0, 9), OPT_INTRANGE("png-filter", png_filter, 0, 0, 5), OPT_STRING("format", format, 0), @@ -193,8 +195,10 @@ static bool write_jpeg(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp cinfo.optimize_coding = ctx->opts->jpeg_optimize; cinfo.smoothing_factor = ctx->opts->jpeg_smooth; - cinfo.comp_info[0].h_samp_factor = 1 << ctx->original_format.chroma_xs; - cinfo.comp_info[0].v_samp_factor = 1 << ctx->original_format.chroma_ys; + if (ctx->opts->jpeg_source_chroma) { + cinfo.comp_info[0].h_samp_factor = 1 << ctx->original_format.chroma_xs; + cinfo.comp_info[0].v_samp_factor = 1 << ctx->original_format.chroma_ys; + } jpeg_start_compress(&cinfo, TRUE); diff --git a/video/image_writer.h b/video/image_writer.h index b27db3981a..5e41d79abb 100644 --- a/video/image_writer.h +++ b/video/image_writer.h @@ -28,6 +28,7 @@ struct image_writer_opts { int jpeg_dpi; int jpeg_progressive; int jpeg_baseline; + int jpeg_source_chroma; int tag_csp; }; |