I'm incorporating most of your suggestions in a revised patch - just to answer
>> @@ -171,11 +297,11 @@ static av_cold int hap_close(AVCodecContext *avctx) >> #define OFFSET(x) offsetof(HapContext, x) >> #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM >> static const AVOption options[] = { >> - { "format", NULL, OFFSET(section_type), AV_OPT_TYPE_INT, { .i64 = >> HAP_FMT_RGBDXT1 }, HAP_FMT_RGBDXT1, HAP_FMT_YCOCGDXT5, FLAGS, "format" }, >> + { "format", NULL, OFFSET(opt_tex_fmt), AV_OPT_TYPE_INT, { .i64 = >> HAP_FMT_RGBDXT1 }, HAP_FMT_RGBDXT1, HAP_FMT_YCOCGDXT5, FLAGS, "format" }, >> { "hap", "Hap 1 (DXT1 textures)", 0, AV_OPT_TYPE_CONST, { >> .i64 = HAP_FMT_RGBDXT1 }, 0, 0, FLAGS, "format" }, >> { "hap_alpha", "Hap Alpha (DXT5 textures)", 0, AV_OPT_TYPE_CONST, { >> .i64 = HAP_FMT_RGBADXT5 }, 0, 0, FLAGS, "format" }, >> { "hap_q", "Hap Q (DXT5-YCoCg textures)", 0, AV_OPT_TYPE_CONST, >> { .i64 = HAP_FMT_YCOCGDXT5 }, 0, 0, FLAGS, "format" }, >> - >> + { "chunks", "chunk count", OFFSET(opt_chunk_count), AV_OPT_TYPE_INT, >> {.i64 = 1 }, 1, HAP_MAX_CHUNKS, FLAGS, }, >> { NULL }, >> }; > > is there any way to automate this? Eg ideally > chunks = -1 -> no complex encoding > chunks = 0 -> automatic selection of the optimal chunk number > chunks = N -> user selection of chunk number Yes but in many cases 1 (the default) is the optimal number (and in this patch that results in no complex encoding). The optimal chunk size isn't trivial to determine as there is some payoff between increased file size and the number of chunks (with chunking Snappy loses opportunities for compression). Some users select chunk counts to match a known number of cores on the decoding machine. I think automatic selection is a good idea for future work. _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel