summaryrefslogtreecommitdiff
path: root/libavcodec/j2kenc.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-03 16:49:19 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-03 16:49:19 +0000
commitf3af379b5c1816271b1afce0ccb2a935dc29940c (patch)
tree629aec01a415bfe4a0552d31292adbb01b31d180 /libavcodec/j2kenc.c
parent908d010b12fadc36d8cadf6bba5e073e23b9603c (diff)
parent2862b63783b5556f7f3fb2d097629bc6879f833a (diff)
Merge commit '2862b63783b5556f7f3fb2d097629bc6879f833a'
* commit '2862b63783b5556f7f3fb2d097629bc6879f833a': lavc: Move prediction_method to codec private options Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/j2kenc.c')
-rw-r--r--libavcodec/j2kenc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index 152da8bdfd..2cd837d8be 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -88,6 +88,7 @@ typedef struct {
Jpeg2000Tile *tile;
int format;
+ int pred;
} Jpeg2000EncoderContext;
@@ -1069,6 +1070,13 @@ static av_cold int j2kenc_init(AVCodecContext *avctx)
s->avctx = avctx;
av_log(s->avctx, AV_LOG_DEBUG, "init\n");
+#if FF_API_PRIVATE_OPT
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->prediction_method)
+ s->pred = avctx->prediction_method;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+
// defaults:
// TODO: implement setting non-standard precinct size
memset(codsty->log2_prec_widths , 15, sizeof(codsty->log2_prec_widths ));
@@ -1077,7 +1085,7 @@ static av_cold int j2kenc_init(AVCodecContext *avctx)
codsty->nreslevels = 7;
codsty->log2_cblk_width = 4;
codsty->log2_cblk_height = 4;
- codsty->transform = avctx->prediction_method ? FF_DWT53 : FF_DWT97_INT;
+ codsty->transform = s->pred ? FF_DWT53 : FF_DWT97_INT;
qntsty->nguardbits = 1;
@@ -1139,6 +1147,9 @@ static const AVOption options[] = {
{ "jp2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CODEC_JP2 }, 0, 0, VE, "format" },
{ "tile_width", "Tile Width", OFFSET(tile_width), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, 1<<30, VE, },
{ "tile_height", "Tile Height", OFFSET(tile_height), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, 1<<30, VE, },
+ { "pred", "DWT Type", OFFSET(pred), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE, "pred" },
+ { "dwt97int", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "pred" },
+ { "dwt53", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "pred" },
{ NULL }
};