Merge remote-tracking branch 'qatar/master'

* qatar/master: (31 commits)
  tiffenc: initialize forgotten avctx.
  avplay: free the active audio packet at exit.
  avplay: free rdft data used for spectrogram analysis.
  log.h: make AVClass a named struct
  fix ac3 encoder documentation
  vc1: more prettyprinting cosmetics
  vc1: prettyprint some tables
  vc1: K&R formatting cosmetics
  AVOptions: bump minor and add APIchanges entry.
  cmdutils/avtools: simplify show_help() by using av_opt_child_class_next()
  AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*
  Remove all uses of deprecated AVOptions API.
  AVOptions: add av_opt_next, deprecate av_next_option.
  AVOptions: add functions for evaluating option strings.
  AVOptions: split get_number().
  AVOptions: add av_opt_get*, deprecate av_get*.
  AVOptions: add av_opt_set*().
  AVOptions: add new API for enumerating children.
  rv34: move inverse transform functions to DSP context
  flvenc: Write the right metadata entry count
  ...

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	ffplay.c
	ffprobe.c
	libavcodec/ac3dec.c
	libavcodec/h264.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mpeg12enc.c
	libavcodec/options.c
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavfilter/vf_drawtext.c
	libavformat/flvdec.c
	libavformat/mpegtsenc.c
	libavformat/options.c
	libavutil/avutil.h
	libavutil/opt.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/2/head
Michael Niedermayer 13 years ago
commit f884ef00de
  1. 51
      avconv.c
  2. 14
      cmdutils.c
  3. 6
      cmdutils.h
  4. 4
      configure
  5. 19
      doc/APIchanges
  6. 8
      doc/encoders.texi
  7. 51
      ffmpeg.c
  8. 21
      ffplay.c
  9. 6
      ffprobe.c
  10. 6
      ffserver.c
  11. 4
      libavcodec/Makefile
  12. 8
      libavcodec/aacenc.c
  13. 12
      libavcodec/ac3dec.c
  14. 78
      libavcodec/ac3enc_opts_template.c
  15. 2
      libavcodec/dnxhdenc.c
  16. 32
      libavcodec/flacenc.c
  17. 2
      libavcodec/libmp3lame.c
  18. 2
      libavcodec/libopencore-amr.c
  19. 2
      libavcodec/libvo-amrwbenc.c
  20. 2
      libavcodec/libvorbis.c
  21. 33
      libavcodec/libvpxenc.c
  22. 148
      libavcodec/libx264.c
  23. 26
      libavcodec/libxavs.c
  24. 2
      libavcodec/mjpegdec.c
  25. 10
      libavcodec/mpeg12enc.c
  26. 4
      libavcodec/mpeg4videoenc.c
  27. 12
      libavcodec/mpegvideo_enc.c
  28. 808
      libavcodec/options.c
  29. 2
      libavcodec/qdm2_tablegen.h
  30. 3
      libavcodec/rv30dsp.c
  31. 82
      libavcodec/rv34.c
  32. 106
      libavcodec/rv34dsp.c
  33. 4
      libavcodec/rv34dsp.h
  34. 3
      libavcodec/rv40dsp.c
  35. 2
      libavcodec/snow.c
  36. 10
      libavcodec/vc1.h
  37. 733
      libavcodec/vc1data.c
  38. 643
      libavcodec/vc1dec.c
  39. 4
      libavdevice/alsa-audio-dec.c
  40. 18
      libavdevice/bktr.c
  41. 8
      libavdevice/dv1394.c
  42. 2
      libavdevice/fbdev.c
  43. 2
      libavdevice/jack_audio.c
  44. 10
      libavdevice/libcdio.c
  45. 6
      libavdevice/libdc1394.c
  46. 4
      libavdevice/oss_audio.c
  47. 4
      libavdevice/sndio_dec.c
  48. 8
      libavdevice/v4l.c
  49. 10
      libavdevice/v4l2.c
  50. 4
      libavdevice/vfwcap.c
  51. 12
      libavdevice/x11grab.c
  52. 12
      libavfilter/src_movie.c
  53. 60
      libavfilter/vf_drawtext.c
  54. 4
      libavformat/applehttp.c
  55. 4
      libavformat/crypto.c
  56. 28
      libavformat/flvdec.c
  57. 13
      libavformat/flvenc.c
  58. 2
      libavformat/gif.c
  59. 2
      libavformat/http.c
  60. 8
      libavformat/img2.c
  61. 2
      libavformat/latmenc.c
  62. 4
      libavformat/movenc.c
  63. 4
      libavformat/mp3enc.c
  64. 2
      libavformat/mpegts.c
  65. 12
      libavformat/mpegtsenc.c
  66. 16
      libavformat/mxfenc.c
  67. 93
      libavformat/options.c
  68. 4
      libavformat/pcmdec.c
  69. 2
      libavformat/rawdec.c
  70. 6
      libavformat/rawvideodec.c
  71. 6
      libavformat/rtp.c
  72. 12
      libavformat/rtpdec.c
  73. 20
      libavformat/rtpdec.h
  74. 2
      libavformat/rtpenc.c
  75. 4
      libavformat/rtpenc.h
  76. 13
      libavformat/rtpenc_chain.c
  77. 8
      libavformat/rtpproto.c
  78. 27
      libavformat/rtsp.c
  79. 3
      libavformat/rtsp.h
  80. 2
      libavformat/rtspdec.c
  81. 8
      libavformat/spdifenc.c
  82. 6
      libavformat/tty.c
  83. 2
      libavformat/wav.c
  84. 4
      libavutil/avutil.h
  85. 18
      libavutil/log.h
  86. 431
      libavutil/opt.c
  87. 167
      libavutil/opt.h
  88. 54
      libswscale/options.c

@ -240,7 +240,7 @@ typedef struct OutputStream {
AVFilterGraph *graph; AVFilterGraph *graph;
#endif #endif
int sws_flags; int64_t sws_flags;
AVDictionary *opts; AVDictionary *opts;
int is_past_recording_time; int is_past_recording_time;
} OutputStream; } OutputStream;
@ -450,7 +450,7 @@ static int configure_video_filters(InputStream *ist, OutputStream *ost)
snprintf(args, 255, "%d:%d:flags=0x%X", snprintf(args, 255, "%d:%d:flags=0x%X",
codec->width, codec->width,
codec->height, codec->height,
ost->sws_flags); (unsigned)ost->sws_flags);
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"), if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
NULL, args, NULL, ost->graph)) < 0) NULL, args, NULL, ost->graph)) < 0)
return ret; return ret;
@ -459,7 +459,7 @@ static int configure_video_filters(InputStream *ist, OutputStream *ost)
last_filter = filter; last_filter = filter;
} }
snprintf(args, sizeof(args), "flags=0x%X", ost->sws_flags); snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
ost->graph->scale_sws_opts = av_strdup(args); ost->graph->scale_sws_opts = av_strdup(args);
if (ost->avfilter) { if (ost->avfilter) {
@ -3154,7 +3154,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
if (oc->oformat->flags & AVFMT_GLOBALHEADER) if (oc->oformat->flags & AVFMT_GLOBALHEADER)
st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
ost->sws_flags = av_get_int(sws_opts, "sws_flags", NULL); av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags);
return ost; return ost;
} }
@ -3781,11 +3781,7 @@ static void show_usage(void)
static int opt_help(const char *opt, const char *arg) static int opt_help(const char *opt, const char *arg)
{ {
AVCodec *c; int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
AVOutputFormat *oformat = NULL;
AVInputFormat *iformat = NULL;
const AVClass *class;
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
show_usage(); show_usage();
show_help_options(options, "Main options:\n", show_help_options(options, "Main options:\n",
@ -3812,41 +3808,10 @@ static int opt_help(const char *opt, const char *arg)
OPT_GRAB, OPT_GRAB,
OPT_GRAB); OPT_GRAB);
printf("\n"); printf("\n");
class = avcodec_get_class(); show_help_children(avcodec_get_class(), flags);
av_opt_show2(&class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0); show_help_children(avformat_get_class(), flags);
printf("\n"); show_help_children(sws_get_class(), flags);
/* individual codec options */
c = NULL;
while ((c = av_codec_next(c))) {
if (c->priv_class) {
av_opt_show2(&c->priv_class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
}
}
class = avformat_get_class();
av_opt_show2(&class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
/* individual muxer options */
while ((oformat = av_oformat_next(oformat))) {
if (oformat->priv_class) {
av_opt_show2(&oformat->priv_class, NULL, AV_OPT_FLAG_ENCODING_PARAM, 0);
printf("\n");
}
}
/* individual demuxer options */
while ((iformat = av_iformat_next(iformat))) {
if (iformat->priv_class) {
av_opt_show2(&iformat->priv_class, NULL, AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
}
}
class = sws_get_class();
av_opt_show2(&class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
return 0; return 0;
} }

@ -130,6 +130,16 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int
} }
} }
void show_help_children(const AVClass *class, int flags)
{
const AVClass *child = NULL;
av_opt_show2(&class, NULL, flags, 0);
printf("\n");
while (child = av_opt_child_class_next(class, child))
show_help_children(child, flags);
}
static const OptionDef* find_option(const OptionDef *po, const char *name){ static const OptionDef* find_option(const OptionDef *po, const char *name){
const char *p = strchr(name, ':'); const char *p = strchr(name, ':');
int len = p ? p - name : strlen(name); int len = p ? p - name : strlen(name);
@ -342,7 +352,7 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
opt_loglevel("loglevel", argv[idx + 1]); opt_loglevel("loglevel", argv[idx + 1]);
} }
#define FLAGS(o) ((o)->type == FF_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0 #define FLAGS(o) ((o)->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
int opt_default(const char *opt, const char *arg) int opt_default(const char *opt, const char *arg)
{ {
const AVOption *oc, *of, *os; const AVOption *oc, *of, *os;
@ -364,7 +374,7 @@ int opt_default(const char *opt, const char *arg)
sc = sws_get_class(); sc = sws_get_class();
if ((os = av_opt_find(&sc, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { if ((os = av_opt_find(&sc, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
// XXX we only support sws_flags, not arbitrary sws options // XXX we only support sws_flags, not arbitrary sws options
int ret = av_set_string3(sws_opts, opt, arg, 1, NULL); int ret = av_opt_set(sws_opts, opt, arg, 0);
if (ret < 0) { if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
return ret; return ret;

@ -158,6 +158,12 @@ typedef struct {
void show_help_options(const OptionDef *options, const char *msg, int mask, int value); void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
/**
* Show help for all options with given flags in class and all its
* children.
*/
void show_help_children(const AVClass *class, int flags);
/** /**
* Parse the command line arguments. * Parse the command line arguments.
* *

4
configure vendored

@ -3044,8 +3044,8 @@ enabled libvpx && {
enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx || enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx ||
die "ERROR: libvpx encoder version must be >=0.9.6"; } } die "ERROR: libvpx encoder version must be >=0.9.6"; } }
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
{ check_cpp_condition x264.h "X264_BUILD >= 115" || { check_cpp_condition x264.h "X264_BUILD >= 118" ||
die "ERROR: libx264 version must be >= 0.115."; } die "ERROR: libx264 version must be >= 0.118."; }
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do

@ -13,6 +13,25 @@ libavutil: 2011-04-18
API changes, most recent first: API changes, most recent first:
2011-10-12 - lavu 51.12.0
AVOptions API rewrite.
- 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
- new setting/getting functions with slightly different semantics:
dac66da av_set_string3 -> av_opt_set
av_set_double -> av_opt_set_double
av_set_q -> av_opt_set_q
av_set_int -> av_opt_set_int
41d9d51 av_get_string -> av_opt_get
av_get_double -> av_opt_get_double
av_get_q -> av_opt_get_q
av_get_int -> av_opt_get_int
- 8c5dcaa trivial rename av_next_option -> av_opt_next
- 641c7af new functions - av_opt_child_next, av_opt_child_class_next
and av_opt_find2()
2011-09-22 - xxxxxxx - lavu 51.17.0 2011-09-22 - xxxxxxx - lavu 51.17.0
Add av_x_if_null(). Add av_x_if_null().

@ -320,10 +320,10 @@ apply Dolby Surround EX processing.
Not Indicated (default) Not Indicated (default)
@item 1 @item 1
@itemx on @itemx on
Dolby Surround EX On Dolby Surround EX Off
@item 2 @item 2
@itemx off @itemx off
Dolby Surround EX Off Dolby Surround EX On
@end table @end table
@item -dheadphone_mode @var{mode} @item -dheadphone_mode @var{mode}
@ -337,10 +337,10 @@ processing.
Not Indicated (default) Not Indicated (default)
@item 1 @item 1
@itemx on @itemx on
Dolby Headphone On Dolby Headphone Off
@item 2 @item 2
@itemx off @itemx off
Dolby Headphone Off Dolby Headphone On
@end table @end table
@item -ad_conv_type @var{type} @item -ad_conv_type @var{type}

@ -247,7 +247,7 @@ typedef struct OutputStream {
AVFilterGraph *graph; AVFilterGraph *graph;
#endif #endif
int sws_flags; int64_t sws_flags;
AVDictionary *opts; AVDictionary *opts;
int is_past_recording_time; int is_past_recording_time;
} OutputStream; } OutputStream;
@ -460,7 +460,7 @@ static int configure_video_filters(InputStream *ist, OutputStream *ost)
snprintf(args, 255, "%d:%d:flags=0x%X", snprintf(args, 255, "%d:%d:flags=0x%X",
codec->width, codec->width,
codec->height, codec->height,
ost->sws_flags); (unsigned)ost->sws_flags);
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"), if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
NULL, args, NULL, ost->graph)) < 0) NULL, args, NULL, ost->graph)) < 0)
return ret; return ret;
@ -469,7 +469,7 @@ static int configure_video_filters(InputStream *ist, OutputStream *ost)
last_filter = filter; last_filter = filter;
} }
snprintf(args, sizeof(args), "flags=0x%X", ost->sws_flags); snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
ost->graph->scale_sws_opts = av_strdup(args); ost->graph->scale_sws_opts = av_strdup(args);
if (ost->avfilter) { if (ost->avfilter) {
@ -3260,7 +3260,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
if (oc->oformat->flags & AVFMT_GLOBALHEADER) if (oc->oformat->flags & AVFMT_GLOBALHEADER)
st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
ost->sws_flags = av_get_int(sws_opts, "sws_flags", NULL); av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags);
return ost; return ost;
} }
@ -3907,11 +3907,7 @@ static void show_usage(void)
static int opt_help(const char *opt, const char *arg) static int opt_help(const char *opt, const char *arg)
{ {
AVCodec *c; int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
AVOutputFormat *oformat = NULL;
AVInputFormat *iformat = NULL;
const AVClass *class;
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
show_usage(); show_usage();
show_help_options(options, "Main options:\n", show_help_options(options, "Main options:\n",
@ -3938,41 +3934,10 @@ static int opt_help(const char *opt, const char *arg)
OPT_GRAB, OPT_GRAB,
OPT_GRAB); OPT_GRAB);
printf("\n"); printf("\n");
class = avcodec_get_class(); show_help_children(avcodec_get_class(), flags);
av_opt_show2(&class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0); show_help_children(avformat_get_class(), flags);
printf("\n"); show_help_children(sws_get_class(), flags);
/* individual codec options */
c = NULL;
while ((c = av_codec_next(c))) {
if (c->priv_class) {
av_opt_show2(&c->priv_class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
}
}
class = avformat_get_class();
av_opt_show2(&class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
/* individual muxer options */
while ((oformat = av_oformat_next(oformat))) {
if (oformat->priv_class) {
av_opt_show2(&oformat->priv_class, NULL, AV_OPT_FLAG_ENCODING_PARAM, 0);
printf("\n");
}
}
/* individual demuxer options */
while ((iformat = av_iformat_next(iformat))) {
if (iformat->priv_class) {
av_opt_show2(&iformat->priv_class, NULL, AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
}
}
class = sws_get_class();
av_opt_show2(&class, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
return 0; return 0;
} }

@ -2307,6 +2307,12 @@ static void stream_component_close(VideoState *is, int stream_index)
packet_queue_end(&is->audioq); packet_queue_end(&is->audioq);
if (is->swr_ctx) if (is->swr_ctx)
swr_free(&is->swr_ctx); swr_free(&is->swr_ctx);
av_free_packet(&is->audio_pkt);
if (is->rdft) {
av_rdft_end(is->rdft);
av_freep(&is->rdft_data);
}
break; break;
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:
packet_queue_abort(&is->videoq); packet_queue_abort(&is->videoq);
@ -3029,7 +3035,6 @@ static void show_usage(void)
static int opt_help(const char *opt, const char *arg) static int opt_help(const char *opt, const char *arg)
{ {
const AVClass *class;
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
show_usage(); show_usage();
show_help_options(options, "Main options:\n", show_help_options(options, "Main options:\n",
@ -3037,18 +3042,10 @@ static int opt_help(const char *opt, const char *arg)
show_help_options(options, "\nAdvanced options:\n", show_help_options(options, "\nAdvanced options:\n",
OPT_EXPERT, OPT_EXPERT); OPT_EXPERT, OPT_EXPERT);
printf("\n"); printf("\n");
class = avcodec_get_class(); show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);
av_opt_show2(&class, NULL, show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
AV_OPT_FLAG_DECODING_PARAM, 0);
printf("\n");
class = avformat_get_class();
av_opt_show2(&class, NULL,
AV_OPT_FLAG_DECODING_PARAM, 0);
#if !CONFIG_AVFILTER #if !CONFIG_AVFILTER
printf("\n"); show_help_children(sws_get_class(), AV_OPT_FLAG_ENCODING_PARAM);
class = sws_get_class();
av_opt_show2(&class, NULL,
AV_OPT_FLAG_ENCODING_PARAM, 0);
#endif #endif
printf("\nWhile playing:\n" printf("\nWhile playing:\n"
"q, ESC quit\n" "q, ESC quit\n"

@ -830,13 +830,13 @@ static void opt_input_file(void *optctx, const char *arg)
static int opt_help(const char *opt, const char *arg) static int opt_help(const char *opt, const char *arg)
{ {
const AVClass *class = avformat_get_class();
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
show_usage(); show_usage();
show_help_options(options, "Main options:\n", 0, 0); show_help_options(options, "Main options:\n", 0, 0);
printf("\n"); printf("\n");
av_opt_show2(&class, NULL,
AV_OPT_FLAG_DECODING_PARAM, 0); show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
return 0; return 0;
} }

@ -3169,8 +3169,8 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
switch(rtp_c->rtp_protocol) { switch(rtp_c->rtp_protocol) {
case RTSP_LOWER_TRANSPORT_UDP: case RTSP_LOWER_TRANSPORT_UDP:
rtp_port = rtp_get_local_rtp_port(rtp_c->rtp_handles[stream_index]); rtp_port = ff_rtp_get_local_rtp_port(rtp_c->rtp_handles[stream_index]);
rtcp_port = rtp_get_local_rtcp_port(rtp_c->rtp_handles[stream_index]); rtcp_port = ff_rtp_get_local_rtcp_port(rtp_c->rtp_handles[stream_index]);
avio_printf(c->pb, "Transport: RTP/AVP/UDP;unicast;" avio_printf(c->pb, "Transport: RTP/AVP/UDP;unicast;"
"client_port=%d-%d;server_port=%d-%d", "client_port=%d-%d;server_port=%d-%d",
th->client_port_min, th->client_port_max, th->client_port_min, th->client_port_max,
@ -3938,7 +3938,7 @@ static int ffserver_opt_default(const char *opt, const char *arg,
int ret = 0; int ret = 0;
const AVOption *o = av_opt_find(avctx, opt, NULL, type, 0); const AVOption *o = av_opt_find(avctx, opt, NULL, type, 0);
if(o) if(o)
ret = av_set_string3(avctx, opt, arg, 1, NULL); ret = av_opt_set(avctx, opt, arg, 0);
return ret; return ret;
} }

@ -343,9 +343,9 @@ OBJS-$(CONFIG_RV10_DECODER) += rv10.o
OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o OBJS-$(CONFIG_RV10_ENCODER) += rv10enc.o
OBJS-$(CONFIG_RV20_DECODER) += rv10.o OBJS-$(CONFIG_RV20_DECODER) += rv10.o
OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o OBJS-$(CONFIG_RV20_ENCODER) += rv20enc.o
OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o \ OBJS-$(CONFIG_RV30_DECODER) += rv30.o rv34.o rv30dsp.o rv34dsp.o \
mpegvideo.o error_resilience.o mpegvideo.o error_resilience.o
OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv40dsp.o \ OBJS-$(CONFIG_RV40_DECODER) += rv40.o rv34.o rv34dsp.o rv40dsp.o \
mpegvideo.o error_resilience.o mpegvideo.o error_resilience.o
OBJS-$(CONFIG_S302M_DECODER) += s302m.o OBJS-$(CONFIG_S302M_DECODER) += s302m.o
OBJS-$(CONFIG_SGI_DECODER) += sgidec.o OBJS-$(CONFIG_SGI_DECODER) += sgidec.o

@ -686,10 +686,10 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM #define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
static const AVOption aacenc_options[] = { static const AVOption aacenc_options[] = {
{"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), FF_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"}, {"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), AV_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
{"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"}, {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_off", "Disable Mid/Side coding", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"}, {"ms_off", "Disable Mid/Side coding", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{"ms_force", "Force Mid/Side for the whole frame if possible", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"}, {"ms_force", "Force Mid/Side for the whole frame if possible", 0, AV_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
{NULL} {NULL}
}; };

@ -1451,13 +1451,13 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
#define OFFSET(x) offsetof(AC3DecodeContext, x) #define OFFSET(x) offsetof(AC3DecodeContext, x)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM) #define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM)
static const AVOption options[] = { static const AVOption options[] = {
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR }, { "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {1.0}, 0.0, 1.0, PAR },
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, 0, "dmix_mode"}, {"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 2, 0, "dmix_mode"},
{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0}, {"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0}, {"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0}, {"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0}, {"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
{ NULL}, { NULL},
}; };

@ -30,51 +30,51 @@ static const AVOption ac3_options[] = {
static const AVOption eac3_options[] = { static const AVOption eac3_options[] = {
#endif #endif
/* Metadata Options */ /* Metadata Options */
{"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, AC3ENC_PARAM}, {"per_frame_metadata", "Allow Changing Metadata Per-Frame", OFFSET(allow_per_frame_metadata), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, AC3ENC_PARAM},
#if AC3ENC_TYPE != AC3ENC_TYPE_EAC3 #if AC3ENC_TYPE != AC3ENC_TYPE_EAC3
/* AC-3 downmix levels */ /* AC-3 downmix levels */
{"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM}, {"center_mixlev", "Center Mix Level", OFFSET(center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_4POINT5DB }, 0.0, 1.0, AC3ENC_PARAM},
{"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM}, {"surround_mixlev", "Surround Mix Level", OFFSET(surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = LEVEL_MINUS_6DB }, 0.0, 1.0, AC3ENC_PARAM},
#endif #endif
/* audio production information */ /* audio production information */
{"mixing_level", "Mixing Level", OFFSET(mixing_level), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM}, {"mixing_level", "Mixing Level", OFFSET(mixing_level), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 111, AC3ENC_PARAM},
{"room_type", "Room Type", OFFSET(room_type), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"}, {"room_type", "Room Type", OFFSET(room_type), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_SMALL_ROOM, AC3ENC_PARAM, "room_type"},
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
{"large", "Large Room", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_LARGE_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, {"large", "Large Room", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_LARGE_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
{"small", "Small Room", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_SMALL_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"}, {"small", "Small Room", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_SMALL_ROOM }, INT_MIN, INT_MAX, AC3ENC_PARAM, "room_type"},
/* other metadata options */ /* other metadata options */
{"copyright", "Copyright Bit", OFFSET(copyright), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, {"copyright", "Copyright Bit", OFFSET(copyright), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
{"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), FF_OPT_TYPE_INT, {.dbl = -31 }, -31, -1, AC3ENC_PARAM}, {"dialnorm", "Dialogue Level (dB)", OFFSET(dialogue_level), AV_OPT_TYPE_INT, {.dbl = -31 }, -31, -1, AC3ENC_PARAM},
{"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_OFF, AC3ENC_PARAM, "dsur_mode"}, {"dsur_mode", "Dolby Surround Mode", OFFSET(dolby_surround_mode), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_OFF, AC3ENC_PARAM, "dsur_mode"},
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
{"on", "Dolby Surround Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, {"on", "Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
{"off", "Not Dolby Surround Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"}, {"off", "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
{"original", "Original Bit Stream", OFFSET(original), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM}, {"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
/* extended bitstream information */ /* extended bitstream information */
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_LORO, AC3ENC_PARAM, "dmix_mode"}, {"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_LORO, AC3ENC_PARAM, "dmix_mode"},
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
{"ltrt", "Lt/Rt Downmix Preferred", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"ltrt", "Lt/Rt Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
{"loro", "Lo/Ro Downmix Preferred", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"}, {"loro", "Lo/Ro Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM}, {"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_OFF, AC3ENC_PARAM, "dsurex_mode"}, {"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_OFF, AC3ENC_PARAM, "dsurex_mode"},
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
{"on", "Dolby Surround EX Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"on", "Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
{"off", "Not Dolby Surround EX Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"}, {"off", "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
{"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_OFF, AC3ENC_PARAM, "dheadphone_mode"}, {"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_OFF, AC3ENC_PARAM, "dheadphone_mode"},
{"notindicated", "Not Indicated (default)", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, {"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
{"on", "Dolby Headphone Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, {"on", "Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
{"off", "Not Dolby Headphone Encoded", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"}, {"off", "Not Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
{"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"}, {"ad_conv_type", "A/D Converter Type", OFFSET(ad_converter_type), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_ADCONV_HDCD, AC3ENC_PARAM, "ad_conv_type"},
{"standard", "Standard (default)", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, {"standard", "Standard (default)", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_ADCONV_STANDARD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
{"hdcd", "HDCD", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_ADCONV_HDCD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"}, {"hdcd", "HDCD", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_ADCONV_HDCD }, INT_MIN, INT_MAX, AC3ENC_PARAM, "ad_conv_type"},
/* Other Encoding Options */ /* Other Encoding Options */
{"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_ON }, AC3ENC_OPT_OFF, AC3ENC_OPT_ON, AC3ENC_PARAM}, {"stereo_rematrixing", "Stereo Rematrixing", OFFSET(stereo_rematrixing), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_ON }, AC3ENC_OPT_OFF, AC3ENC_OPT_ON, AC3ENC_PARAM},
{"channel_coupling", "Channel Coupling", OFFSET(channel_coupling), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"}, {"channel_coupling", "Channel Coupling", OFFSET(channel_coupling), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, AC3ENC_OPT_ON, AC3ENC_PARAM, "channel_coupling"},
{"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"}, {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "channel_coupling"},
{"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), FF_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"}, {"cpl_start_band", "Coupling Start Band", OFFSET(cpl_start), AV_OPT_TYPE_INT, {.dbl = AC3ENC_OPT_AUTO }, AC3ENC_OPT_AUTO, 15, AC3ENC_PARAM, "cpl_start_band"},
{"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"}, {"auto", "Selected by the Encoder", 0, AV_OPT_TYPE_CONST, {.dbl = AC3ENC_OPT_AUTO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "cpl_start_band"},
{NULL} {NULL}
}; };

@ -37,7 +37,7 @@
#define DNX10BIT_QMAT_SHIFT 18 // The largest value that will not lead to overflow for 10bit samples. #define DNX10BIT_QMAT_SHIFT 18 // The largest value that will not lead to overflow for 10bit samples.
static const AVOption options[]={ static const AVOption options[]={
{"nitris_compat", "encode with Avid Nitris compatibility", offsetof(DNXHDEncContext, nitris_compat), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, VE}, {"nitris_compat", "encode with Avid Nitris compatibility", offsetof(DNXHDEncContext, nitris_compat), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, VE},
{NULL} {NULL}
}; };
static const AVClass class = { "dnxhd", av_default_item_name, options, LIBAVUTIL_VERSION_INT }; static const AVClass class = { "dnxhd", av_default_item_name, options, LIBAVUTIL_VERSION_INT };

@ -1352,22 +1352,22 @@ static av_cold int flac_encode_close(AVCodecContext *avctx)
#define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM #define FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "lpc_coeff_precision", "LPC coefficient precision", offsetof(FlacEncodeContext, options.lpc_coeff_precision), FF_OPT_TYPE_INT, {.dbl = 15 }, 0, MAX_LPC_PRECISION, FLAGS }, { "lpc_coeff_precision", "LPC coefficient precision", offsetof(FlacEncodeContext, options.lpc_coeff_precision), AV_OPT_TYPE_INT, {.dbl = 15 }, 0, MAX_LPC_PRECISION, FLAGS },
{ "lpc_type", "LPC algorithm", offsetof(FlacEncodeContext, options.lpc_type), FF_OPT_TYPE_INT, {.dbl = FF_LPC_TYPE_DEFAULT }, FF_LPC_TYPE_DEFAULT, FF_LPC_TYPE_NB-1, FLAGS, "lpc_type" }, { "lpc_type", "LPC algorithm", offsetof(FlacEncodeContext, options.lpc_type), AV_OPT_TYPE_INT, {.dbl = FF_LPC_TYPE_DEFAULT }, FF_LPC_TYPE_DEFAULT, FF_LPC_TYPE_NB-1, FLAGS, "lpc_type" },
{ "none", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_NONE }, INT_MIN, INT_MAX, FLAGS, "lpc_type" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_NONE }, INT_MIN, INT_MAX, FLAGS, "lpc_type" },
{ "fixed", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, FLAGS, "lpc_type" }, { "fixed", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, FLAGS, "lpc_type" },
{ "levinson", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, FLAGS, "lpc_type" }, { "levinson", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, FLAGS, "lpc_type" },
{ "cholesky", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, FLAGS, "lpc_type" }, { "cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, FLAGS, "lpc_type" },
{ "lpc_passes", "Number of passes to use for Cholesky factorization during LPC analysis", offsetof(FlacEncodeContext, options.lpc_passes), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, FLAGS }, { "lpc_passes", "Number of passes to use for Cholesky factorization during LPC analysis", offsetof(FlacEncodeContext, options.lpc_passes), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, FLAGS },
{ "min_partition_order", NULL, offsetof(FlacEncodeContext, options.min_partition_order), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, MAX_PARTITION_ORDER, FLAGS }, { "min_partition_order", NULL, offsetof(FlacEncodeContext, options.min_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, MAX_PARTITION_ORDER, FLAGS },
{ "max_partition_order", NULL, offsetof(FlacEncodeContext, options.max_partition_order), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, MAX_PARTITION_ORDER, FLAGS }, { "max_partition_order", NULL, offsetof(FlacEncodeContext, options.max_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, MAX_PARTITION_ORDER, FLAGS },
{ "prediction_order_method", "Search method for selecting prediction order", offsetof(FlacEncodeContext, options.prediction_order_method), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, ORDER_METHOD_LOG, FLAGS, "predm" }, { "prediction_order_method", "Search method for selecting prediction order", offsetof(FlacEncodeContext, options.prediction_order_method), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, ORDER_METHOD_LOG, FLAGS, "predm" },
{ "estimation", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_EST }, INT_MIN, INT_MAX, FLAGS, "predm" }, { "estimation", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_EST }, INT_MIN, INT_MAX, FLAGS, "predm" },
{ "2level", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_2LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" }, { "2level", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_2LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" },
{ "4level", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_4LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" }, { "4level", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_4LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" },
{ "8level", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_8LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" }, { "8level", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_8LEVEL }, INT_MIN, INT_MAX, FLAGS, "predm" },
{ "search", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_SEARCH }, INT_MIN, INT_MAX, FLAGS, "predm" }, { "search", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_SEARCH }, INT_MIN, INT_MAX, FLAGS, "predm" },
{ "log", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_LOG }, INT_MIN, INT_MAX, FLAGS, "predm" }, { "log", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = ORDER_METHOD_LOG }, INT_MIN, INT_MAX, FLAGS, "predm" },
{ NULL }, { NULL },
}; };

@ -277,7 +277,7 @@ static av_cold int MP3lame_encode_close(AVCodecContext *avctx)
#define OFFSET(x) offsetof(Mp3AudioContext, x) #define OFFSET(x) offsetof(Mp3AudioContext, x)
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "reservoir", "Use bit reservoir.", OFFSET(reservoir), FF_OPT_TYPE_INT, { 1 }, 0, 1, AE }, { "reservoir", "Use bit reservoir.", OFFSET(reservoir), AV_OPT_TYPE_INT, { 1 }, 0, 1, AE },
{ NULL }, { NULL },
}; };

@ -88,7 +88,7 @@ typedef struct AMRContext {
} AMRContext; } AMRContext;
static const AVOption options[] = { static const AVOption options[] = {
{ "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), FF_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL } { NULL }
}; };

@ -34,7 +34,7 @@ typedef struct AMRWBContext {
} AMRWBContext; } AMRWBContext;
static const AVOption options[] = { static const AVOption options[] = {
{ "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), FF_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL } { NULL }
}; };

@ -56,7 +56,7 @@ typedef struct OggVorbisContext {
} OggVorbisContext ; } OggVorbisContext ;
static const AVOption options[]={ static const AVOption options[]={
{"iblock", "Sets the impulse block bias", offsetof(OggVorbisContext, iblock), FF_OPT_TYPE_DOUBLE, {.dbl = 0}, -15, 0, AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_ENCODING_PARAM}, {"iblock", "Sets the impulse block bias", offsetof(OggVorbisContext, iblock), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, -15, 0, AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_ENCODING_PARAM},
{NULL} {NULL}
}; };
static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT }; static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };

@ -547,30 +547,29 @@ static int vp8_encode(AVCodecContext *avctx, uint8_t *buf, int buf_size,
#define OFFSET(x) offsetof(VP8Context, x) #define OFFSET(x) offsetof(VP8Context, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "cpu-used", "Quality/Speed ratio modifier", OFFSET(cpu_used), FF_OPT_TYPE_INT, {INT_MIN}, INT_MIN, INT_MAX, VE}, { "cpu-used", "Quality/Speed ratio modifier", OFFSET(cpu_used), AV_OPT_TYPE_INT, {INT_MIN}, INT_MIN, INT_MAX, VE},
{ "auto-alt-ref", "Enable use of alternate reference " { "auto-alt-ref", "Enable use of alternate reference "
"frames (2-pass only)", OFFSET(auto_alt_ref), FF_OPT_TYPE_INT, {-1}, -1, 1, VE}, "frames (2-pass only)", OFFSET(auto_alt_ref), AV_OPT_TYPE_INT, {-1}, -1, 1, VE},
{ "lag-in-frames", "Number of frames to look ahead for " { "lag-in-frames", "Number of frames to look ahead for "
"alternate reference frame selection", OFFSET(lag_in_frames), FF_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE}, "alternate reference frame selection", OFFSET(lag_in_frames), AV_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE},
{ "arnr-maxframes", "altref noise reduction max frame count", OFFSET(arnr_max_frames), FF_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE}, { "arnr-maxframes", "altref noise reduction max frame count", OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE},
{ "arnr-strength", "altref noise reduction filter strength", OFFSET(arnr_strength), FF_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE}, { "arnr-strength", "altref noise reduction filter strength", OFFSET(arnr_strength), AV_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE},
{ "arnr-type", "altref noise reduction filter type", OFFSET(arnr_type), FF_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE, "arnr_type"}, { "arnr-type", "altref noise reduction filter type", OFFSET(arnr_type), AV_OPT_TYPE_INT, {-1}, -1, INT_MAX, VE, "arnr_type"},
{ "backward", NULL, 0, FF_OPT_TYPE_CONST, {1}, 0, 0, VE, "arnr_type" }, { "backward", NULL, 0, AV_OPT_TYPE_CONST, {1}, 0, 0, VE, "arnr_type" },
{ "forward", NULL, 0, FF_OPT_TYPE_CONST, {2}, 0, 0, VE, "arnr_type" }, { "forward", NULL, 0, AV_OPT_TYPE_CONST, {2}, 0, 0, VE, "arnr_type" },
{ "centered", NULL, 0, FF_OPT_TYPE_CONST, {3}, 0, 0, VE, "arnr_type" }, { "centered", NULL, 0, AV_OPT_TYPE_CONST, {3}, 0, 0, VE, "arnr_type" },
{ "deadline", "Time to spend encoding, in microseconds.", OFFSET(deadline), FF_OPT_TYPE_INT, {VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, { "deadline", "Time to spend encoding, in microseconds.", OFFSET(deadline), AV_OPT_TYPE_INT, {VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"},
{ "best", NULL, 0, FF_OPT_TYPE_CONST, {VPX_DL_BEST_QUALITY}, 0, 0, VE, "quality"}, { "best", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_BEST_QUALITY}, 0, 0, VE, "quality"},
{ "good", NULL, 0, FF_OPT_TYPE_CONST, {VPX_DL_GOOD_QUALITY}, 0, 0, VE, "quality"}, { "good", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_GOOD_QUALITY}, 0, 0, VE, "quality"},
{ "realtime", NULL, 0, FF_OPT_TYPE_CONST, {VPX_DL_REALTIME}, 0, 0, VE, "quality"}, { "realtime", NULL, 0, AV_OPT_TYPE_CONST, {VPX_DL_REALTIME}, 0, 0, VE, "quality"},
{ "error-resilient", "Error resilience configuration", OFFSET(error_resilient), FF_OPT_TYPE_FLAGS, {0}, INT_MIN, INT_MAX, VE, "er"}, { "error-resilient", "Error resilience configuration", OFFSET(error_resilient), AV_OPT_TYPE_FLAGS, {0}, INT_MIN, INT_MAX, VE, "er"},
#ifdef VPX_ERROR_RESILIENT_DEFAULT #ifdef VPX_ERROR_RESILIENT_DEFAULT
{ "default", "Improve resiliency against losses of whole frames", 0, FF_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_DEFAULT}, 0, 0, VE, "er"}, { "default", "Improve resiliency against losses of whole frames", 0, AV_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_DEFAULT}, 0, 0, VE, "er"},
{ "partitions", "The frame partitions are independently decodable " { "partitions", "The frame partitions are independently decodable "
"by the bool decoder, meaning that partitions can be decoded even " "by the bool decoder, meaning that partitions can be decoded even "
"though earlier partitions have been lost. Note that intra predicition" "though earlier partitions have been lost. Note that intra predicition"
" is still done over the partition boundary.", 0, FF_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_PARTITIONS}, 0, 0, VE, "er"}, " is still done over the partition boundary.", 0, AV_OPT_TYPE_CONST, {VPX_ERROR_RESILIENT_PARTITIONS}, 0, 0, VE, "er"},
#endif #endif
{"speed", "", offsetof(VP8Context, cpu_used), FF_OPT_TYPE_INT, {.dbl = 3}, -16, 16, VE}, {"speed", "", offsetof(VP8Context, cpu_used), FF_OPT_TYPE_INT, {.dbl = 3}, -16, 16, VE},
{"quality", "", offsetof(VP8Context, deadline), FF_OPT_TYPE_INT, {.dbl = VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, {"quality", "", offsetof(VP8Context, deadline), FF_OPT_TYPE_INT, {.dbl = VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"},

@ -127,30 +127,6 @@ static int encode_nals(AVCodecContext *ctx, uint8_t *buf, int size,
return p - buf; return p - buf;
} }
static int avfmt2_csp(int avfmt)
{
switch (avfmt) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUVJ420P:
case PIX_FMT_YUV420P9:
case PIX_FMT_YUV420P10:
return X264_CSP_I420;
#ifdef X264_CSP_I444
case PIX_FMT_YUV444P:
return X264_CSP_I444;
#endif
#ifdef X264_CSP_BGR
case PIX_FMT_BGR24:
return X264_CSP_BGR;
case PIX_FMT_RGB24:
return X264_CSP_RGB;
#endif
default:
return X264_CSP_NONE;
}
}
static int avfmt2_num_planes(int avfmt) static int avfmt2_num_planes(int avfmt)
{ {
switch (avfmt) { switch (avfmt) {
@ -181,7 +157,7 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
int bufsize; int bufsize;
x264_picture_init( &x4->pic ); x264_picture_init( &x4->pic );
x4->pic.img.i_csp = avfmt2_csp(ctx->pix_fmt); x4->pic.img.i_csp = x4->params.i_csp;
if (x264_bit_depth > 8) if (x264_bit_depth > 8)
x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH; x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt); x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
@ -271,6 +247,29 @@ static av_cold int X264_close(AVCodecContext *avctx)
} \ } \
} while (0); } while (0);
static int convert_pix_fmt(enum PixelFormat pix_fmt)
{
switch (pix_fmt) {
case PIX_FMT_YUV420P:
case PIX_FMT_YUVJ420P:
case PIX_FMT_YUV420P9:
case PIX_FMT_YUV420P10: return X264_CSP_I420;
case PIX_FMT_YUV422P:
case PIX_FMT_YUV422P10: return X264_CSP_I422;
case PIX_FMT_YUV444P:
case PIX_FMT_YUV444P9:
case PIX_FMT_YUV444P10: return X264_CSP_I444;
#ifdef X264_CSP_BGR
case PIX_FMT_BGR24:
return X264_CSP_BGR;
case PIX_FMT_RGB24:
return X264_CSP_RGB;
#endif
};
return 0;
}
#define PARSE_X264_OPT(name, var)\ #define PARSE_X264_OPT(name, var)\
if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\ if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\
av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\ av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\
@ -300,6 +299,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.pf_log = X264_log; x4->params.pf_log = X264_log;
x4->params.p_log_private = avctx; x4->params.p_log_private = avctx;
x4->params.i_log_level = X264_LOG_DEBUG; x4->params.i_log_level = X264_LOG_DEBUG;
x4->params.i_csp = convert_pix_fmt(avctx->pix_fmt);
OPT_STR("weightp", x4->wpredp); OPT_STR("weightp", x4->wpredp);
@ -533,8 +533,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
avctx->crf = x4->params.rc.f_rf_constant; avctx->crf = x4->params.rc.f_rf_constant;
#endif #endif
x4->params.i_csp = avfmt2_csp(avctx->pix_fmt);
x4->enc = x264_encoder_open(&x4->params); x4->enc = x264_encoder_open(&x4->params);
if (!x4->enc) if (!x4->enc)
return -1; return -1;
@ -561,9 +559,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
static const enum PixelFormat pix_fmts_8bit[] = { static const enum PixelFormat pix_fmts_8bit[] = {
PIX_FMT_YUV420P, PIX_FMT_YUV420P,
PIX_FMT_YUVJ420P, PIX_FMT_YUVJ420P,
#ifdef X264_CSP_I444 PIX_FMT_YUV422P,
PIX_FMT_YUV444P, PIX_FMT_YUV444P,
#endif
#ifdef X264_CSP_BGR #ifdef X264_CSP_BGR
PIX_FMT_BGR24, PIX_FMT_BGR24,
PIX_FMT_RGB24, PIX_FMT_RGB24,
@ -572,10 +569,13 @@ static const enum PixelFormat pix_fmts_8bit[] = {
}; };
static const enum PixelFormat pix_fmts_9bit[] = { static const enum PixelFormat pix_fmts_9bit[] = {
PIX_FMT_YUV420P9, PIX_FMT_YUV420P9,
PIX_FMT_YUV444P9,
PIX_FMT_NONE PIX_FMT_NONE
}; };
static const enum PixelFormat pix_fmts_10bit[] = { static const enum PixelFormat pix_fmts_10bit[] = {
PIX_FMT_YUV420P10, PIX_FMT_YUV420P10,
PIX_FMT_YUV422P10,
PIX_FMT_YUV444P10,
PIX_FMT_NONE PIX_FMT_NONE
}; };
@ -592,52 +592,52 @@ static av_cold void X264_init_static(AVCodec *codec)
#define OFFSET(x) offsetof(X264Context, x) #define OFFSET(x) offsetof(X264Context, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "preset", "Set the encoding preset (cf. x264 --fullhelp)", OFFSET(preset), FF_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE}, { "preset", "Set the encoding preset (cf. x264 --fullhelp)", OFFSET(preset), AV_OPT_TYPE_STRING, { .str = "medium" }, 0, 0, VE},
{ "tune", "Tune the encoding params (cf. x264 --fullhelp)", OFFSET(tune), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, { "tune", "Tune the encoding params (cf. x264 --fullhelp)", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
{ "profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, { "profile", "Set profile restrictions (cf. x264 --fullhelp) ", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
{ "fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), FF_OPT_TYPE_INT, { 1 }, 0, 1, VE}, { "fastfirstpass", "Use fast settings when encoding first pass", OFFSET(fastfirstpass), AV_OPT_TYPE_INT, { 1 }, 0, 1, VE},
{"level", "Specify level (as defined by Annex A)", OFFSET(level), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, {"level", "Specify level (as defined by Annex A)", OFFSET(level), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
{"passlogfile", "Filename for 2 pass stats", OFFSET(stats), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, {"passlogfile", "Filename for 2 pass stats", OFFSET(stats), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
{"wpredp", "Weighted prediction for P-frames", OFFSET(wpredp), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, {"wpredp", "Weighted prediction for P-frames", OFFSET(wpredp), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
{"x264opts", "x264 options", OFFSET(x264opts), FF_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE}, {"x264opts", "x264 options", OFFSET(x264opts), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, VE},
{ "crf", "Select the quality for constant quality mode", OFFSET(crf), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE }, { "crf", "Select the quality for constant quality mode", OFFSET(crf), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE },
{ "crf_max", "In CRF mode, prevents VBV from lowering quality beyond this point.",OFFSET(crf_max), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE }, { "crf_max", "In CRF mode, prevents VBV from lowering quality beyond this point.",OFFSET(crf_max), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE },
{ "qp", "Constant quantization parameter rate control method",OFFSET(cqp), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE }, { "qp", "Constant quantization parameter rate control method",OFFSET(cqp), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
{ "aq-mode", "AQ method", OFFSET(aq_mode), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "aq_mode"}, { "aq-mode", "AQ method", OFFSET(aq_mode), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "aq_mode"},
{ "none", NULL, 0, FF_OPT_TYPE_CONST, {X264_AQ_NONE}, INT_MIN, INT_MAX, VE, "aq_mode" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, {X264_AQ_NONE}, INT_MIN, INT_MAX, VE, "aq_mode" },
{ "variance", "Variance AQ (complexity mask)", 0, FF_OPT_TYPE_CONST, {X264_AQ_VARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" }, { "variance", "Variance AQ (complexity mask)", 0, AV_OPT_TYPE_CONST, {X264_AQ_VARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" },
{ "autovariance", "Auto-variance AQ (experimental)", 0, FF_OPT_TYPE_CONST, {X264_AQ_AUTOVARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" }, { "autovariance", "Auto-variance AQ (experimental)", 0, AV_OPT_TYPE_CONST, {X264_AQ_AUTOVARIANCE}, INT_MIN, INT_MAX, VE, "aq_mode" },
{ "aq-strength", "AQ strength. Reduces blocking and blurring in flat and textured areas.", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {-1}, -1, FLT_MAX, VE}, { "aq-strength", "AQ strength. Reduces blocking and blurring in flat and textured areas.", OFFSET(aq_strength), AV_OPT_TYPE_FLOAT, {-1}, -1, FLT_MAX, VE},
{ "psy", "Use psychovisual optimizations.", OFFSET(psy), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE }, { "psy", "Use psychovisual optimizations.", OFFSET(psy), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE },
{ "psy-rd", "Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.", OFFSET(psy_rd), FF_OPT_TYPE_STRING, {0 }, 0, 0, VE}, { "psy-rd", "Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.", OFFSET(psy_rd), AV_OPT_TYPE_STRING, {0 }, 0, 0, VE},
{ "rc-lookahead", "Number of frames to look ahead for frametype and ratecontrol", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE }, { "rc-lookahead", "Number of frames to look ahead for frametype and ratecontrol", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
{ "weightb", "Weighted prediction for B-frames.", OFFSET(weightb), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE }, { "weightb", "Weighted prediction for B-frames.", OFFSET(weightb), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE },
{ "weightp", "Weighted prediction analysis method.", OFFSET(weightp), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "weightp" }, { "weightp", "Weighted prediction analysis method.", OFFSET(weightp), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "weightp" },
{ "none", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_NONE}, INT_MIN, INT_MAX, VE, "weightp" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_NONE}, INT_MIN, INT_MAX, VE, "weightp" },
{ "simple", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" }, { "simple", NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" },
{ "smart", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SMART}, INT_MIN, INT_MAX, VE, "weightp" }, { "smart", NULL, 0, AV_OPT_TYPE_CONST, {X264_WEIGHTP_SMART}, INT_MIN, INT_MAX, VE, "weightp" },
{ "ssim", "Calculate and print SSIM stats.", OFFSET(ssim), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE }, { "ssim", "Calculate and print SSIM stats.", OFFSET(ssim), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE },
{ "intra-refresh", "Use Periodic Intra Refresh instead of IDR frames.",OFFSET(intra_refresh),FF_OPT_TYPE_INT, {-1 }, -1, 1, VE }, { "intra-refresh", "Use Periodic Intra Refresh instead of IDR frames.",OFFSET(intra_refresh),AV_OPT_TYPE_INT, {-1 }, -1, 1, VE },
{ "b-bias", "Influences how often B-frames are used", OFFSET(b_bias), FF_OPT_TYPE_INT, {INT_MIN}, INT_MIN, INT_MAX, VE }, { "b-bias", "Influences how often B-frames are used", OFFSET(b_bias), AV_OPT_TYPE_INT, {INT_MIN}, INT_MIN, INT_MAX, VE },
{ "b-pyramid", "Keep some B-frames as references.", OFFSET(b_pyramid), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "b_pyramid" }, { "b-pyramid", "Keep some B-frames as references.", OFFSET(b_pyramid), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "b_pyramid" },
{ "none", NULL, 0, FF_OPT_TYPE_CONST, {X264_B_PYRAMID_NONE}, INT_MIN, INT_MAX, VE, "b_pyramid" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, {X264_B_PYRAMID_NONE}, INT_MIN, INT_MAX, VE, "b_pyramid" },
{ "strict", "Strictly hierarchical pyramid", 0, FF_OPT_TYPE_CONST, {X264_B_PYRAMID_STRICT}, INT_MIN, INT_MAX, VE, "b_pyramid" }, { "strict", "Strictly hierarchical pyramid", 0, AV_OPT_TYPE_CONST, {X264_B_PYRAMID_STRICT}, INT_MIN, INT_MAX, VE, "b_pyramid" },
{ "normal", "Non-strict (not Blu-ray compatible)", 0, FF_OPT_TYPE_CONST, {X264_B_PYRAMID_NORMAL}, INT_MIN, INT_MAX, VE, "b_pyramid" }, { "normal", "Non-strict (not Blu-ray compatible)", 0, AV_OPT_TYPE_CONST, {X264_B_PYRAMID_NORMAL}, INT_MIN, INT_MAX, VE, "b_pyramid" },
{ "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), FF_OPT_TYPE_INT, {-1}, -1, 1, VE }, { "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), AV_OPT_TYPE_INT, {-1}, -1, 1, VE },
{ "8x8dct", "High profile 8x8 transform.", OFFSET(dct8x8), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "8x8dct", "High profile 8x8 transform.", OFFSET(dct8x8), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "fast-pskip", NULL, OFFSET(fast_pskip), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "fast-pskip", NULL, OFFSET(fast_pskip), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "aud", "Use access unit delimiters.", OFFSET(aud), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "aud", "Use access unit delimiters.", OFFSET(aud), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "deblock", "Loop filter parameters, in <alpha:beta> form.", OFFSET(deblock), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, { "deblock", "Loop filter parameters, in <alpha:beta> form.", OFFSET(deblock), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
{ "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE}, { "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE},
{ "partitions", "A comma-separated list of partitions to consider. " { "partitions", "A comma-separated list of partitions to consider. "
"Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all", OFFSET(partitions), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, "Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all", OFFSET(partitions), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE},
{ "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "direct-pred" }, { "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "direct-pred" },
{ "none", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, { X264_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" },
{ "spatial", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" }, { "spatial", NULL, 0, AV_OPT_TYPE_CONST, { X264_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" },
{ "temporal", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" }, { "temporal", NULL, 0, AV_OPT_TYPE_CONST, { X264_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" },
{ "auto", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" }, { "auto", NULL, 0, AV_OPT_TYPE_CONST, { X264_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" },
{ "slice-max-size","Constant quantization parameter rate control method",OFFSET(slice_max_size), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE }, { "slice-max-size","Constant quantization parameter rate control method",OFFSET(slice_max_size), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
{ NULL }, { NULL },
}; };

@ -378,19 +378,19 @@ static av_cold int XAVS_init(AVCodecContext *avctx)
#define OFFSET(x) offsetof(XavsContext, x) #define OFFSET(x) offsetof(XavsContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "crf", "Select the quality for constant quality mode", OFFSET(crf), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE }, { "crf", "Select the quality for constant quality mode", OFFSET(crf), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE },
{ "qp", "Constant quantization parameter rate control method",OFFSET(cqp), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE }, { "qp", "Constant quantization parameter rate control method",OFFSET(cqp), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
{ "b-bias", "Influences how often B-frames are used", OFFSET(b_bias), FF_OPT_TYPE_INT, {INT_MIN}, INT_MIN, INT_MAX, VE }, { "b-bias", "Influences how often B-frames are used", OFFSET(b_bias), AV_OPT_TYPE_INT, {INT_MIN}, INT_MIN, INT_MAX, VE },
{ "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE}, { "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), AV_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE},
{ "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "direct-pred" }, { "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), AV_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "direct-pred" },
{ "none", NULL, 0, FF_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" }, { "none", NULL, 0, AV_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" },
{ "spatial", NULL, 0, FF_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" }, { "spatial", NULL, 0, AV_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" },
{ "temporal", NULL, 0, FF_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" }, { "temporal", NULL, 0, AV_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" },
{ "auto", NULL, 0, FF_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" }, { "auto", NULL, 0, AV_OPT_TYPE_CONST, { XAVS_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" },
{ "aud", "Use access unit delimiters.", OFFSET(aud), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "aud", "Use access unit delimiters.", OFFSET(aud), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "mbtree", "Use macroblock tree ratecontrol.", OFFSET(mbtree), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), FF_OPT_TYPE_INT, {-1}, -1, 1, VE }, { "mixed-refs", "One reference per partition, as opposed to one reference per macroblock", OFFSET(mixed_refs), AV_OPT_TYPE_INT, {-1}, -1, 1, VE },
{ "fast-pskip", NULL, OFFSET(fast_pskip), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE}, { "fast-pskip", NULL, OFFSET(fast_pskip), AV_OPT_TYPE_INT, {-1 }, -1, 1, VE},
{ NULL }, { NULL },
}; };

@ -1591,7 +1591,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
#define OFFSET(x) offsetof(MJpegDecodeContext, x) #define OFFSET(x) offsetof(MJpegDecodeContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "extern_huff", "Use external huffman table.", OFFSET(extern_huff), FF_OPT_TYPE_INT, { 0 }, 0, 1, VD }, { "extern_huff", "Use external huffman table.", OFFSET(extern_huff), AV_OPT_TYPE_INT, { 0 }, 0, 1, VD },
{ NULL }, { NULL },
}; };

@ -943,9 +943,9 @@ static void mpeg1_encode_block(MpegEncContext *s,
#define COMMON_OPTS\ #define COMMON_OPTS\
{TIMECODE_OPT(MpegEncContext,\ {TIMECODE_OPT(MpegEncContext,\
AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)},\ AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)},\
{ "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },\ { "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },\
{ "drop_frame_timecode", "Timecode is in drop frame format.", OFFSET(drop_frame_timecode), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE}, \ { "drop_frame_timecode", "Timecode is in drop frame format.", OFFSET(drop_frame_timecode), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE}, \
{ "scan_offset", "Reserve space for SVCD scan offset user data.", OFFSET(scan_offset), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "scan_offset", "Reserve space for SVCD scan offset user data.", OFFSET(scan_offset), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
static const AVOption mpeg1_options[] = { static const AVOption mpeg1_options[] = {
COMMON_OPTS COMMON_OPTS
@ -954,8 +954,8 @@ static const AVOption mpeg1_options[] = {
static const AVOption mpeg2_options[] = { static const AVOption mpeg2_options[] = {
COMMON_OPTS COMMON_OPTS
{ "non_linear_quant", "Use nonlinear quantizer.", OFFSET(q_scale_type), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "non_linear_quant", "Use nonlinear quantizer.", OFFSET(q_scale_type), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "alternate_scan", "Enable alternate scantable.", OFFSET(alternate_scan), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "alternate_scan", "Enable alternate scantable.", OFFSET(alternate_scan), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ NULL }, { NULL },
}; };

@ -1289,8 +1289,8 @@ void ff_mpeg4_encode_video_packet_header(MpegEncContext *s)
#define OFFSET(x) offsetof(MpegEncContext, x) #define OFFSET(x) offsetof(MpegEncContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "data_partitioning", "Use data partitioning.", OFFSET(data_partitioning), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "data_partitioning", "Use data partitioning.", OFFSET(data_partitioning), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "alternate_scan", "Enable alternate scantable.", OFFSET(alternate_scan), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "alternate_scan", "Enable alternate scantable.", OFFSET(alternate_scan), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ NULL }, { NULL },
}; };

@ -3825,8 +3825,8 @@ int dct_quantize_c(MpegEncContext *s,
#define OFFSET(x) offsetof(MpegEncContext, x) #define OFFSET(x) offsetof(MpegEncContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption h263_options[] = { static const AVOption h263_options[] = {
{ "obmc", "use overlapped block motion compensation.", OFFSET(obmc), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "obmc", "use overlapped block motion compensation.", OFFSET(obmc), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "structured_slices","Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE}, { "structured_slices","Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE},
{ NULL }, { NULL },
}; };
@ -3851,10 +3851,10 @@ AVCodec ff_h263_encoder = {
}; };
static const AVOption h263p_options[] = { static const AVOption h263p_options[] = {
{ "umv", "Use unlimited motion vectors.", OFFSET(umvplus), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "umv", "Use unlimited motion vectors.", OFFSET(umvplus), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "aiv", "Use alternative inter VLC.", OFFSET(alt_inter_vlc), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "aiv", "Use alternative inter VLC.", OFFSET(alt_inter_vlc), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "obmc", "use overlapped block motion compensation.", OFFSET(obmc), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "obmc", "use overlapped block motion compensation.", OFFSET(obmc), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ "structured_slices", "Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE}, { "structured_slices", "Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE},
{ NULL }, { NULL },
}; };
static const AVClass h263p_class = { static const AVClass h263p_class = {

@ -39,22 +39,27 @@ static const char* context_to_name(void* ptr) {
return "NULL"; return "NULL";
} }
static const AVOption *opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags) static void *codec_child_next(void *obj, void *prev)
{ {
AVCodecContext *s = obj; AVCodecContext *s = obj;
AVCodec *c = NULL; if (!prev && s->codec && s->codec->priv_class && s->priv_data)
return s->priv_data;
if (!(search_flags & AV_OPT_SEARCH_FAKE_OBJ) && s->priv_data) {
if (s->codec && s->codec->priv_class)
return av_opt_find(s->priv_data, name, unit, opt_flags, search_flags);
return NULL; return NULL;
} }
while ((c = av_codec_next(c))) { static const AVClass *codec_child_class_next(const AVClass *prev)
const AVOption *o; {
if (c->priv_class && (o = av_opt_find(&c->priv_class, name, unit, opt_flags, search_flags))) AVCodec *c = NULL;
return o;
} /* find the codec that corresponds to prev */
while (prev && (c = av_codec_next(c)))
if (c->priv_class == prev)
break;
/* find next codec with priv options */
while (c = av_codec_next(c))
if (c->priv_class)
return c->priv_class;
return NULL; return NULL;
} }
@ -70,443 +75,443 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit, i
#define AV_CODEC_DEFAULT_BITRATE 200*1000 #define AV_CODEC_DEFAULT_BITRATE 200*1000
static const AVOption options[]={ static const AVOption options[]={
{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, A|V|E}, {"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, A|V|E},
{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), FF_OPT_TYPE_INT, {.dbl = 128*1000 }, INT_MIN, INT_MAX, A|E}, {"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.dbl = 128*1000 }, INT_MIN, INT_MAX, A|E},
{"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), FF_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E}, {"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E},
{"flags", NULL, OFFSET(flags), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"}, {"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"},
{"mv4", "use four motion vector by macroblock (mpeg4)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"}, {"mv4", "use four motion vector by macroblock (mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"obmc", "use overlapped block motion compensation (h263+)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_OBMC }, INT_MIN, INT_MAX, V|E, "flags"}, {"obmc", "use overlapped block motion compensation (h263+)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_OBMC }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"qpel", "use 1/4 pel motion compensation", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"}, {"qpel", "use 1/4 pel motion compensation", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"},
{"loop", "use loop filter", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"}, {"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"},
{"qscale", "use fixed qscale", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"}, {"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"},
{"gmc", "use gmc", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"}, {"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
{"mv0", "always try a mb with mv=<0,0>", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"}, {"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"part", "use data partitioning", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PART }, INT_MIN, INT_MAX, V|E, "flags"}, {"part", "use data partitioning", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PART }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"input_preserved", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"}, {"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
{"pass1", "use internal 2pass ratecontrol in first pass mode", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"}, {"pass1", "use internal 2pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
{"pass2", "use internal 2pass ratecontrol in second pass mode", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"}, {"pass2", "use internal 2pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
#if FF_API_MJPEG_GLOBAL_OPTS #if FF_API_MJPEG_GLOBAL_OPTS
{"extern_huff", "use external huffman table (for mjpeg)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_EXTERN_HUFF }, INT_MIN, INT_MAX, 0, "flags"}, {"extern_huff", "use external huffman table (for mjpeg)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_EXTERN_HUFF }, INT_MIN, INT_MAX, 0, "flags"},
#endif #endif
{"gray", "only decode/encode grayscale", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"}, {"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"},
{"emu_edge", "don't draw edges", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"}, {"emu_edge", "don't draw edges", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"},
{"psnr", "error[?] variables will be set during encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"}, {"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"},
{"truncated", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"}, {"truncated", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_TRUNCATED }, INT_MIN, INT_MAX, 0, "flags"},
{"naq", "normalize adaptive quantization", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"}, {"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
{"ildct", "use interlaced dct", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"}, {"ildct", "use interlaced dct", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
{"low_delay", "force low delay", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"}, {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"alt", "enable alternate scantable (mpeg2/mpeg4)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_ALT_SCAN }, INT_MIN, INT_MAX, V|E, "flags"}, {"alt", "enable alternate scantable (mpeg2/mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_ALT_SCAN }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"global_header", "place global headers in extradata instead of every keyframe", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"}, {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
{"bitexact", "use only bitexact stuff (except (i)dct)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"}, {"bitexact", "use only bitexact stuff (except (i)dct)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
{"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"}, {"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"umv", "use unlimited motion vectors", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_UMV }, INT_MIN, INT_MAX, V|E, "flags"}, {"umv", "use unlimited motion vectors", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_UMV }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"cbp", "use rate distortion optimization for cbp", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX, V|E, "flags"}, {"cbp", "use rate distortion optimization for cbp", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX, V|E, "flags"},
{"qprd", "use rate distortion optimization for qp selection", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX, V|E, "flags"}, {"qprd", "use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"aiv", "h263 alternative inter vlc", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_AIV }, INT_MIN, INT_MAX, V|E, "flags"}, {"aiv", "h263 alternative inter vlc", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_AIV }, INT_MIN, INT_MAX, V|E, "flags"},
{"slice", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_SLICE_STRUCT }, INT_MIN, INT_MAX, V|E, "flags"}, {"slice", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_SLICE_STRUCT }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"ilme", "interlaced motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"}, {"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"scan_offset", "will reserve space for svcd scan offset user data", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_SVCD_SCAN_OFFSET }, INT_MIN, INT_MAX, V|E, "flags"}, {"scan_offset", "will reserve space for svcd scan offset user data", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_SVCD_SCAN_OFFSET }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"cgop", "closed gop", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"}, {"cgop", "closed gop", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"},
{"fast", "allow non spec compliant speedup tricks", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"}, {"fast", "allow non spec compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
{"sgop", "strictly enforce gop size", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"}, {"sgop", "strictly enforce gop size", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},
{"noout", "skip bitstream encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"}, {"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"},
{"local_header", "place global headers at every keyframe instead of in extradata", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"}, {"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"},
{"showall", "Show all frames before the first keyframe", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"}, {"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"},
{"sub_id", NULL, OFFSET(sub_id), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"sub_id", NULL, OFFSET(sub_id), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"me_method", "set motion estimation method", OFFSET(me_method), FF_OPT_TYPE_INT, {.dbl = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"}, {"me_method", "set motion estimation method", OFFSET(me_method), AV_OPT_TYPE_INT, {.dbl = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method"},
{"zero", "zero motion estimation (fastest)", 0, FF_OPT_TYPE_CONST, {.dbl = ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" }, {"zero", "zero motion estimation (fastest)", 0, AV_OPT_TYPE_CONST, {.dbl = ME_ZERO }, INT_MIN, INT_MAX, V|E, "me_method" },
{"full", "full motion estimation (slowest)", 0, FF_OPT_TYPE_CONST, {.dbl = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" }, {"full", "full motion estimation (slowest)", 0, AV_OPT_TYPE_CONST, {.dbl = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
{"epzs", "EPZS motion estimation (default)", 0, FF_OPT_TYPE_CONST, {.dbl = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" }, {"epzs", "EPZS motion estimation (default)", 0, AV_OPT_TYPE_CONST, {.dbl = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
{"esa", "esa motion estimation (alias for full)", 0, FF_OPT_TYPE_CONST, {.dbl = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" }, {"esa", "esa motion estimation (alias for full)", 0, AV_OPT_TYPE_CONST, {.dbl = ME_FULL }, INT_MIN, INT_MAX, V|E, "me_method" },
{"tesa", "tesa motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_TESA }, INT_MIN, INT_MAX, V|E, "me_method" }, {"tesa", "tesa motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_TESA }, INT_MIN, INT_MAX, V|E, "me_method" },
{"dia", "dia motion estimation (alias for epzs)", 0, FF_OPT_TYPE_CONST, {.dbl = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" }, {"dia", "dia motion estimation (alias for epzs)", 0, AV_OPT_TYPE_CONST, {.dbl = ME_EPZS }, INT_MIN, INT_MAX, V|E, "me_method" },
{"log", "log motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_LOG }, INT_MIN, INT_MAX, V|E, "me_method" }, {"log", "log motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_LOG }, INT_MIN, INT_MAX, V|E, "me_method" },
{"phods", "phods motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_PHODS }, INT_MIN, INT_MAX, V|E, "me_method" }, {"phods", "phods motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_PHODS }, INT_MIN, INT_MAX, V|E, "me_method" },
{"x1", "X1 motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_X1 }, INT_MIN, INT_MAX, V|E, "me_method" }, {"x1", "X1 motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_X1 }, INT_MIN, INT_MAX, V|E, "me_method" },
{"hex", "hex motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" }, {"hex", "hex motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_HEX }, INT_MIN, INT_MAX, V|E, "me_method" },
{"umh", "umh motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" }, {"umh", "umh motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_UMH }, INT_MIN, INT_MAX, V|E, "me_method" },
{"iter", "iter motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = ME_ITER }, INT_MIN, INT_MAX, V|E, "me_method" }, {"iter", "iter motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = ME_ITER }, INT_MIN, INT_MAX, V|E, "me_method" },
{"extradata_size", NULL, OFFSET(extradata_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"time_base", NULL, OFFSET(time_base), FF_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX}, {"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
{"g", "set the group of picture size", OFFSET(gop_size), FF_OPT_TYPE_INT, {.dbl = 12 }, INT_MIN, INT_MAX, V|E}, {"g", "set the group of picture size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.dbl = 12 }, INT_MIN, INT_MAX, V|E},
{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|D|E}, {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
{"ac", "set number of audio channels", OFFSET(channels), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|D|E}, {"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|E}, {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|E},
{"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|E}, {"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|E},
{"frame_number", NULL, OFFSET(frame_number), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"delay", NULL, OFFSET(delay), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"delay", NULL, OFFSET(delay), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), FF_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -FLT_MAX, FLT_MAX, V|E}, {"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), AV_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -FLT_MAX, FLT_MAX, V|E},
{"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), FF_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -1, FLT_MAX, V|E}, {"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), AV_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -1, FLT_MAX, V|E},
{"qmin", "min video quantizer scale (VBR)", OFFSET(qmin), FF_OPT_TYPE_INT, {.dbl = 2 }, -1, 69, V|E}, {"qmin", "min video quantizer scale (VBR)", OFFSET(qmin), AV_OPT_TYPE_INT, {.dbl = 2 }, -1, 69, V|E},
{"qmax", "max video quantizer scale (VBR)", OFFSET(qmax), FF_OPT_TYPE_INT, {.dbl = 31 }, -1, 69, V|E}, {"qmax", "max video quantizer scale (VBR)", OFFSET(qmax), AV_OPT_TYPE_INT, {.dbl = 31 }, -1, 69, V|E},
{"qdiff", "max difference between the quantizer scale (VBR)", OFFSET(max_qdiff), FF_OPT_TYPE_INT, {.dbl = 3 }, INT_MIN, INT_MAX, V|E}, {"qdiff", "max difference between the quantizer scale (VBR)", OFFSET(max_qdiff), AV_OPT_TYPE_INT, {.dbl = 3 }, INT_MIN, INT_MAX, V|E},
{"bf", "use 'frames' B frames", OFFSET(max_b_frames), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -1, FF_MAX_B_FRAMES, V|E}, {"bf", "use 'frames' B frames", OFFSET(max_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, -1, FF_MAX_B_FRAMES, V|E},
{"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E}, {"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
{"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), FF_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E}, {"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E}, {"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E},
#endif #endif
{"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"mv_bits", NULL, OFFSET(mv_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"header_bits", NULL, OFFSET(header_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"header_bits", NULL, OFFSET(header_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"i_tex_bits", NULL, OFFSET(i_tex_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"i_tex_bits", NULL, OFFSET(i_tex_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"p_tex_bits", NULL, OFFSET(p_tex_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"p_tex_bits", NULL, OFFSET(p_tex_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"i_count", NULL, OFFSET(i_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"i_count", NULL, OFFSET(i_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"p_count", NULL, OFFSET(p_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"p_count", NULL, OFFSET(p_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"skip_count", NULL, OFFSET(skip_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"skip_count", NULL, OFFSET(skip_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"misc_bits", NULL, OFFSET(misc_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"misc_bits", NULL, OFFSET(misc_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"frame_bits", NULL, OFFSET(frame_bits), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"frame_bits", NULL, OFFSET(frame_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"codec_tag", NULL, OFFSET(codec_tag), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"codec_tag", NULL, OFFSET(codec_tag), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"bug", "workaround not auto detected encoder bugs", OFFSET(workaround_bugs), FF_OPT_TYPE_FLAGS, {.dbl = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"}, {"bug", "workaround not auto detected encoder bugs", OFFSET(workaround_bugs), AV_OPT_TYPE_FLAGS, {.dbl = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"},
{"autodetect", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"}, {"autodetect", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"},
{"old_msmpeg4", "some old lavc generated msmpeg4v3 files (no autodetection)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_OLD_MSMPEG4 }, INT_MIN, INT_MAX, V|D, "bug"}, {"old_msmpeg4", "some old lavc generated msmpeg4v3 files (no autodetection)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_OLD_MSMPEG4 }, INT_MIN, INT_MAX, V|D, "bug"},
{"xvid_ilace", "Xvid interlacing bug (autodetected if fourcc==XVIX)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_XVID_ILACE }, INT_MIN, INT_MAX, V|D, "bug"}, {"xvid_ilace", "Xvid interlacing bug (autodetected if fourcc==XVIX)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_XVID_ILACE }, INT_MIN, INT_MAX, V|D, "bug"},
{"ump4", "(autodetected if fourcc==UMP4)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_UMP4 }, INT_MIN, INT_MAX, V|D, "bug"}, {"ump4", "(autodetected if fourcc==UMP4)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_UMP4 }, INT_MIN, INT_MAX, V|D, "bug"},
{"no_padding", "padding bug (autodetected)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_NO_PADDING }, INT_MIN, INT_MAX, V|D, "bug"}, {"no_padding", "padding bug (autodetected)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_NO_PADDING }, INT_MIN, INT_MAX, V|D, "bug"},
{"amv", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_AMV }, INT_MIN, INT_MAX, V|D, "bug"}, {"amv", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_AMV }, INT_MIN, INT_MAX, V|D, "bug"},
{"ac_vlc", "illegal vlc bug (autodetected per fourcc)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_AC_VLC }, INT_MIN, INT_MAX, V|D, "bug"}, {"ac_vlc", "illegal vlc bug (autodetected per fourcc)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_AC_VLC }, INT_MIN, INT_MAX, V|D, "bug"},
{"qpel_chroma", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_QPEL_CHROMA }, INT_MIN, INT_MAX, V|D, "bug"}, {"qpel_chroma", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_QPEL_CHROMA }, INT_MIN, INT_MAX, V|D, "bug"},
{"std_qpel", "old standard qpel (autodetected per fourcc/version)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_STD_QPEL }, INT_MIN, INT_MAX, V|D, "bug"}, {"std_qpel", "old standard qpel (autodetected per fourcc/version)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_STD_QPEL }, INT_MIN, INT_MAX, V|D, "bug"},
{"qpel_chroma2", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_QPEL_CHROMA2 }, INT_MIN, INT_MAX, V|D, "bug"}, {"qpel_chroma2", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_QPEL_CHROMA2 }, INT_MIN, INT_MAX, V|D, "bug"},
{"direct_blocksize", "direct-qpel-blocksize bug (autodetected per fourcc/version)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_DIRECT_BLOCKSIZE }, INT_MIN, INT_MAX, V|D, "bug"}, {"direct_blocksize", "direct-qpel-blocksize bug (autodetected per fourcc/version)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_DIRECT_BLOCKSIZE }, INT_MIN, INT_MAX, V|D, "bug"},
{"edge", "edge padding bug (autodetected per fourcc/version)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_EDGE }, INT_MIN, INT_MAX, V|D, "bug"}, {"edge", "edge padding bug (autodetected per fourcc/version)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_EDGE }, INT_MIN, INT_MAX, V|D, "bug"},
{"hpel_chroma", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_HPEL_CHROMA }, INT_MIN, INT_MAX, V|D, "bug"}, {"hpel_chroma", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_HPEL_CHROMA }, INT_MIN, INT_MAX, V|D, "bug"},
{"dc_clip", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_DC_CLIP }, INT_MIN, INT_MAX, V|D, "bug"}, {"dc_clip", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_DC_CLIP }, INT_MIN, INT_MAX, V|D, "bug"},
{"ms", "workaround various bugs in microsofts broken decoders", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_MS }, INT_MIN, INT_MAX, V|D, "bug"}, {"ms", "workaround various bugs in microsofts broken decoders", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_MS }, INT_MIN, INT_MAX, V|D, "bug"},
{"trunc", "trancated frames", 0, FF_OPT_TYPE_CONST, {.dbl = FF_BUG_TRUNCATED}, INT_MIN, INT_MAX, V|D, "bug"}, {"trunc", "trancated frames", 0, AV_OPT_TYPE_CONST, {.dbl = FF_BUG_TRUNCATED}, INT_MIN, INT_MAX, V|D, "bug"},
{"lelim", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)", OFFSET(luma_elim_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"lelim", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)", OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"celim", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)", OFFSET(chroma_elim_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"celim", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)", OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|V|D|E, "strict"}, {"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|V|D|E, "strict"},
{"very", "strictly conform to a older more strict version of the spec or reference software", 0, FF_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"strict", "strictly conform to all the things in the spec no matter what consequences", 0, FF_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"strict", "strictly conform to all the things in the spec no matter what consequences", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"normal", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"normal", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"unofficial", "allow unofficial extensions", 0, FF_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"experimental", "allow non standardized experimental things", 0, FF_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"experimental", "allow non standardized experimental things", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, V|D|E, "strict"},
{"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), FF_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E}, {"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
{"er", "set error detection aggressivity", OFFSET(error_recognition), FF_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "er"}, {"er", "set error detection aggressivity", OFFSET(error_recognition), AV_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "er"},
{"careful", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, V|D, "er"}, {"careful", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, V|D, "er"},
{"compliant", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_COMPLIANT }, INT_MIN, INT_MAX, V|D, "er"}, {"compliant", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_COMPLIANT }, INT_MIN, INT_MAX, V|D, "er"},
{"aggressive", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"}, {"aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
#if FF_API_VERY_AGGRESSIVE #if FF_API_VERY_AGGRESSIVE
{"very_aggressive", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"}, {"very_aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
#endif /* FF_API_VERY_AGGRESSIVE */ #endif /* FF_API_VERY_AGGRESSIVE */
{"explode", "abort decoding on error recognition", 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"}, {"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"},
{"has_b_frames", NULL, OFFSET(has_b_frames), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"block_align", NULL, OFFSET(block_align), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"parse_only", NULL, OFFSET(parse_only), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"parse_only", NULL, OFFSET(parse_only), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"stats_out", NULL, OFFSET(stats_out), FF_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, {"stats_out", NULL, OFFSET(stats_out), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX},
{"stats_in", NULL, OFFSET(stats_in), FF_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, {"stats_in", NULL, OFFSET(stats_in), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX},
{"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E}, {"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E},
{"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, {"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
{"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"rc_override_count", NULL, OFFSET(rc_override_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"rc_override_count", NULL, OFFSET(rc_override_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"rc_eq", "set rate control equation", OFFSET(rc_eq), FF_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, V|E}, {"rc_eq", "set rate control equation", OFFSET(rc_eq), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, V|E},
{"maxrate", "set max video bitrate tolerance (in bits/s)", OFFSET(rc_max_rate), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"maxrate", "set max video bitrate tolerance (in bits/s)", OFFSET(rc_max_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"minrate", "set min video bitrate tolerance (in bits/s)", OFFSET(rc_min_rate), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"minrate", "set min video bitrate tolerance (in bits/s)", OFFSET(rc_min_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"bufsize", "set ratecontrol buffer size (in bits)", OFFSET(rc_buffer_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|V|E}, {"bufsize", "set ratecontrol buffer size (in bits)", OFFSET(rc_buffer_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, A|V|E},
{"rc_buf_aggressivity", "currently useless", OFFSET(rc_buffer_aggressivity), FF_OPT_TYPE_FLOAT, {.dbl = 1.0 }, -FLT_MAX, FLT_MAX, V|E}, {"rc_buf_aggressivity", "currently useless", OFFSET(rc_buffer_aggressivity), AV_OPT_TYPE_FLOAT, {.dbl = 1.0 }, -FLT_MAX, FLT_MAX, V|E},
{"i_qfactor", "qp factor between P and I frames", OFFSET(i_quant_factor), FF_OPT_TYPE_FLOAT, {.dbl = -0.8 }, -FLT_MAX, FLT_MAX, V|E}, {"i_qfactor", "qp factor between P and I frames", OFFSET(i_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = -0.8 }, -FLT_MAX, FLT_MAX, V|E},
{"i_qoffset", "qp offset between P and I frames", OFFSET(i_quant_offset), FF_OPT_TYPE_FLOAT, {.dbl = 0.0 }, -FLT_MAX, FLT_MAX, V|E}, {"i_qoffset", "qp offset between P and I frames", OFFSET(i_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, -FLT_MAX, FLT_MAX, V|E},
{"rc_init_cplx", "initial complexity for 1-pass encoding", OFFSET(rc_initial_cplx), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, {"rc_init_cplx", "initial complexity for 1-pass encoding", OFFSET(rc_initial_cplx), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
{"dct", "DCT algorithm", OFFSET(dct_algo), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, V|E, "dct"}, {"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, V|E, "dct"},
{"auto", "autoselect a good one (default)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"}, {"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
{"fastint", "fast integer", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"}, {"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
{"int", "accurate integer", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"}, {"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"},
{"mmx", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"}, {"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"},
{"mlib", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_MLIB }, INT_MIN, INT_MAX, V|E, "dct"}, {"mlib", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_MLIB }, INT_MIN, INT_MAX, V|E, "dct"},
{"altivec", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"}, {"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"},
{"faan", "floating point AAN DCT", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"}, {"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
{"lumi_mask", "compresses bright areas stronger than medium ones", OFFSET(lumi_masking), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, {"lumi_mask", "compresses bright areas stronger than medium ones", OFFSET(lumi_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
{"tcplx_mask", "temporal complexity masking", OFFSET(temporal_cplx_masking), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, {"tcplx_mask", "temporal complexity masking", OFFSET(temporal_cplx_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
{"scplx_mask", "spatial complexity masking", OFFSET(spatial_cplx_masking), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, {"scplx_mask", "spatial complexity masking", OFFSET(spatial_cplx_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
{"p_mask", "inter masking", OFFSET(p_masking), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, {"p_mask", "inter masking", OFFSET(p_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
{"dark_mask", "compresses dark areas stronger than medium ones", OFFSET(dark_masking), FF_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, {"dark_mask", "compresses dark areas stronger than medium ones", OFFSET(dark_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E},
{"idct", "select IDCT implementation", OFFSET(idct_algo), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, V|E|D, "idct"}, {"idct", "select IDCT implementation", OFFSET(idct_algo), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, V|E|D, "idct"},
{"auto", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_AUTO }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"auto", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_AUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"int", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_INT }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"int", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_INT }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simple", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simple", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplemmx", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"libmpeg2mmx", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_LIBMPEG2MMX }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"libmpeg2mmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_LIBMPEG2MMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"ps2", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_PS2 }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"ps2", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_PS2 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"mlib", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_MLIB }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"mlib", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_MLIB }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"arm", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"arm", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"altivec", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"sh4", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"sh4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearm", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simplearm", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearmv5te", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simplearmv5te", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplearmv6", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simplearmv6", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simpleneon", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLENEON }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simpleneon", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLENEON }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplealpha", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simplealpha", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"h264", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_H264 }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"h264", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_H264 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"vp3", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_VP3 }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"vp3", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_VP3 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"ipp", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"ipp", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"xvidmmx", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_XVIDMMX }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"xvidmmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_XVIDMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"faani", "floating point AAN IDCT", 0, FF_OPT_TYPE_CONST, {.dbl = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"}, {"faani", "floating point AAN IDCT", 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
{"slice_count", NULL, OFFSET(slice_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"slice_count", NULL, OFFSET(slice_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"ec", "set error concealment strategy", OFFSET(error_concealment), FF_OPT_TYPE_FLAGS, {.dbl = 3 }, INT_MIN, INT_MAX, V|D, "ec"}, {"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.dbl = 3 }, INT_MIN, INT_MAX, V|D, "ec"},
{"guess_mvs", "iterative motion vector (MV) search (slow)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"}, {"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"},
{"deblock", "use strong deblock filter for damaged MBs", 0, FF_OPT_TYPE_CONST, {.dbl = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"}, {"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, {.dbl = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"},
{"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"pred", "prediction method", OFFSET(prediction_method), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "pred"}, {"pred", "prediction method", OFFSET(prediction_method), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "pred"},
{"left", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PRED_LEFT }, INT_MIN, INT_MAX, V|E, "pred"}, {"left", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PRED_LEFT }, INT_MIN, INT_MAX, V|E, "pred"},
{"plane", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PRED_PLANE }, INT_MIN, INT_MAX, V|E, "pred"}, {"plane", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PRED_PLANE }, INT_MIN, INT_MAX, V|E, "pred"},
{"median", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PRED_MEDIAN }, INT_MIN, INT_MAX, V|E, "pred"}, {"median", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PRED_MEDIAN }, INT_MIN, INT_MAX, V|E, "pred"},
{"aspect", "sample aspect ratio", OFFSET(sample_aspect_ratio), FF_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E}, {"aspect", "sample aspect ratio", OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E},
{"debug", "print specific debug info", OFFSET(debug), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, V|A|S|E|D, "debug"}, {"debug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, V|A|S|E|D, "debug"},
{"pict", "picture info", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_PICT_INFO }, INT_MIN, INT_MAX, V|D, "debug"}, {"pict", "picture info", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_PICT_INFO }, INT_MIN, INT_MAX, V|D, "debug"},
{"rc", "rate control", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_RC }, INT_MIN, INT_MAX, V|E, "debug"}, {"rc", "rate control", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_RC }, INT_MIN, INT_MAX, V|E, "debug"},
{"bitstream", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_BITSTREAM }, INT_MIN, INT_MAX, V|D, "debug"}, {"bitstream", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_BITSTREAM }, INT_MIN, INT_MAX, V|D, "debug"},
{"mb_type", "macroblock (MB) type", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"}, {"mb_type", "macroblock (MB) type", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
{"qp", "per-block quantization parameter (QP)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_QP }, INT_MIN, INT_MAX, V|D, "debug"}, {"qp", "per-block quantization parameter (QP)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_QP }, INT_MIN, INT_MAX, V|D, "debug"},
{"mv", "motion vector", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_MV }, INT_MIN, INT_MAX, V|D, "debug"}, {"mv", "motion vector", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_MV }, INT_MIN, INT_MAX, V|D, "debug"},
{"dct_coeff", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_DCT_COEFF }, INT_MIN, INT_MAX, V|D, "debug"}, {"dct_coeff", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_DCT_COEFF }, INT_MIN, INT_MAX, V|D, "debug"},
{"skip", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_SKIP }, INT_MIN, INT_MAX, V|D, "debug"}, {"skip", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_SKIP }, INT_MIN, INT_MAX, V|D, "debug"},
{"startcode", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_STARTCODE }, INT_MIN, INT_MAX, V|D, "debug"}, {"startcode", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_STARTCODE }, INT_MIN, INT_MAX, V|D, "debug"},
{"pts", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_PTS }, INT_MIN, INT_MAX, V|D, "debug"}, {"pts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_PTS }, INT_MIN, INT_MAX, V|D, "debug"},
{"er", "error recognition", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_ER }, INT_MIN, INT_MAX, V|D, "debug"}, {"er", "error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_ER }, INT_MIN, INT_MAX, V|D, "debug"},
{"mmco", "memory management control operations (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_MMCO }, INT_MIN, INT_MAX, V|D, "debug"}, {"mmco", "memory management control operations (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_MMCO }, INT_MIN, INT_MAX, V|D, "debug"},
{"bugs", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_BUGS }, INT_MIN, INT_MAX, V|D, "debug"}, {"bugs", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_BUGS }, INT_MIN, INT_MAX, V|D, "debug"},
{"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_QP }, INT_MIN, INT_MAX, V|D, "debug"}, {"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_QP }, INT_MIN, INT_MAX, V|D, "debug"},
{"vis_mb_type", "visualize block types", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"}, {"vis_mb_type", "visualize block types", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
{"buffers", "picture buffer allocations", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, "debug"}, {"buffers", "picture buffer allocations", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, "debug"},
{"thread_ops", "threading operations", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|D, "debug"}, {"thread_ops", "threading operations", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|D, "debug"},
{"vismv", "visualize motion vectors (MVs)", OFFSET(debug_mv), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, V|D, "debug_mv"}, {"vismv", "visualize motion vectors (MVs)", OFFSET(debug_mv), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, V|D, "debug_mv"},
{"pf", "forward predicted MVs of P-frames", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MV_P_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"}, {"pf", "forward predicted MVs of P-frames", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MV_P_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"},
{"bf", "forward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MV_B_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"}, {"bf", "forward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MV_B_FOR }, INT_MIN, INT_MAX, V|D, "debug_mv"},
{"bb", "backward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MV_B_BACK }, INT_MIN, INT_MAX, V|D, "debug_mv"}, {"bb", "backward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.dbl = FF_DEBUG_VIS_MV_B_BACK }, INT_MIN, INT_MAX, V|D, "debug_mv"},
{"cmp", "full pel me compare function", OFFSET(me_cmp), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"cmp", "full pel me compare function", OFFSET(me_cmp), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"subcmp", "sub pel me compare function", OFFSET(me_sub_cmp), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"subcmp", "sub pel me compare function", OFFSET(me_sub_cmp), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"mbcmp", "macroblock compare function", OFFSET(mb_cmp), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"mbcmp", "macroblock compare function", OFFSET(mb_cmp), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"ildctcmp", "interlaced dct compare function", OFFSET(ildct_cmp), FF_OPT_TYPE_INT, {.dbl = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"ildctcmp", "interlaced dct compare function", OFFSET(ildct_cmp), AV_OPT_TYPE_INT, {.dbl = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"dia_size", "diamond type & size for motion estimation", OFFSET(dia_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"dia_size", "diamond type & size for motion estimation", OFFSET(dia_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"last_pred", "amount of motion predictors from the previous frame", OFFSET(last_predictor_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"last_pred", "amount of motion predictors from the previous frame", OFFSET(last_predictor_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"preme", "pre motion estimation", OFFSET(pre_me), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"preme", "pre motion estimation", OFFSET(pre_me), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"precmp", "pre motion estimation compare function", OFFSET(me_pre_cmp), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"precmp", "pre motion estimation compare function", OFFSET(me_pre_cmp), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"sad", "sum of absolute differences, fast (default)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_SAD }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"sad", "sum of absolute differences, fast (default)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_SAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"sse", "sum of squared errors", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_SSE }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"sse", "sum of squared errors", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_SSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"satd", "sum of absolute Hadamard transformed differences", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_SATD }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"satd", "sum of absolute Hadamard transformed differences", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_SATD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"dct", "sum of absolute DCT transformed differences", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_DCT }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"dct", "sum of absolute DCT transformed differences", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_DCT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"psnr", "sum of squared quantization errors (avoid, low quality)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_PSNR }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"psnr", "sum of squared quantization errors (avoid, low quality)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_PSNR }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"bit", "number of bits needed for the block", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_BIT }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"bit", "number of bits needed for the block", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_BIT }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"rd", "rate distortion optimal, slow", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_RD }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"rd", "rate distortion optimal, slow", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_RD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"zero", "0", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_ZERO }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"zero", "0", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_ZERO }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"vsad", "sum of absolute vertical differences", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"vsad", "sum of absolute vertical differences", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"vsse", "sum of squared vertical differences", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_VSSE }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"vsse", "sum of squared vertical differences", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_VSSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"nsse", "noise preserving sum of squared differences", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_NSSE }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"nsse", "noise preserving sum of squared differences", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_NSSE }, INT_MIN, INT_MAX, V|E, "cmp_func"},
#if CONFIG_SNOW_ENCODER #if CONFIG_SNOW_ENCODER
{"w53", "5/3 wavelet, only used in snow", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_W53 }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"w53", "5/3 wavelet, only used in snow", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_W53 }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"w97", "9/7 wavelet, only used in snow", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_W97 }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"w97", "9/7 wavelet, only used in snow", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_W97 }, INT_MIN, INT_MAX, V|E, "cmp_func"},
#endif #endif
{"dctmax", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"dctmax", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"chroma", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_CMP_CHROMA }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"chroma", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_CMP_CHROMA }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"pre_dia_size", "diamond type & size for motion estimation pre-pass", OFFSET(pre_dia_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"pre_dia_size", "diamond type & size for motion estimation pre-pass", OFFSET(pre_dia_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"subq", "sub pel motion estimation quality", OFFSET(me_subpel_quality), FF_OPT_TYPE_INT, {.dbl = 8 }, INT_MIN, INT_MAX, V|E}, {"subq", "sub pel motion estimation quality", OFFSET(me_subpel_quality), AV_OPT_TYPE_INT, {.dbl = 8 }, INT_MIN, INT_MAX, V|E},
{"dtg_active_format", NULL, OFFSET(dtg_active_format), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"dtg_active_format", NULL, OFFSET(dtg_active_format), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"ibias", "intra quant bias", OFFSET(intra_quant_bias), FF_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E}, {"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
{"pbias", "inter quant bias", OFFSET(inter_quant_bias), FF_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E}, {"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
{"color_table_id", NULL, OFFSET(color_table_id), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"color_table_id", NULL, OFFSET(color_table_id), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"internal_buffer_count", NULL, OFFSET(internal_buffer_count), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"internal_buffer_count", NULL, OFFSET(internal_buffer_count), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"global_quality", NULL, OFFSET(global_quality), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
{"coder", NULL, OFFSET(coder_type), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"}, {"coder", NULL, OFFSET(coder_type), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"},
{"vlc", "variable length coder / huffman coder", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"}, {"vlc", "variable length coder / huffman coder", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"},
{"ac", "arithmetic coder", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_AC }, INT_MIN, INT_MAX, V|E, "coder"}, {"ac", "arithmetic coder", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_AC }, INT_MIN, INT_MAX, V|E, "coder"},
{"raw", "raw (no encoding)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_RAW }, INT_MIN, INT_MAX, V|E, "coder"}, {"raw", "raw (no encoding)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_RAW }, INT_MIN, INT_MAX, V|E, "coder"},
{"rle", "run-length coder", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_RLE }, INT_MIN, INT_MAX, V|E, "coder"}, {"rle", "run-length coder", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_RLE }, INT_MIN, INT_MAX, V|E, "coder"},
{"deflate", "deflate-based coder", 0, FF_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_DEFLATE }, INT_MIN, INT_MAX, V|E, "coder"}, {"deflate", "deflate-based coder", 0, AV_OPT_TYPE_CONST, {.dbl = FF_CODER_TYPE_DEFLATE }, INT_MIN, INT_MAX, V|E, "coder"},
{"context", "context model", OFFSET(context_model), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"context", "context model", OFFSET(context_model), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"slice_flags", NULL, OFFSET(slice_flags), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"mbd", "macroblock decision algorithm (high quality mode)", OFFSET(mb_decision), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "mbd"}, {"mbd", "macroblock decision algorithm (high quality mode)", OFFSET(mb_decision), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "mbd"},
{"simple", "use mbcmp (default)", 0, FF_OPT_TYPE_CONST, {.dbl = FF_MB_DECISION_SIMPLE }, INT_MIN, INT_MAX, V|E, "mbd"}, {"simple", "use mbcmp (default)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MB_DECISION_SIMPLE }, INT_MIN, INT_MAX, V|E, "mbd"},
{"bits", "use fewest bits", 0, FF_OPT_TYPE_CONST, {.dbl = FF_MB_DECISION_BITS }, INT_MIN, INT_MAX, V|E, "mbd"}, {"bits", "use fewest bits", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MB_DECISION_BITS }, INT_MIN, INT_MAX, V|E, "mbd"},
{"rd", "use best rate distortion", 0, FF_OPT_TYPE_CONST, {.dbl = FF_MB_DECISION_RD }, INT_MIN, INT_MAX, V|E, "mbd"}, {"rd", "use best rate distortion", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MB_DECISION_RD }, INT_MIN, INT_MAX, V|E, "mbd"},
{"stream_codec_tag", NULL, OFFSET(stream_codec_tag), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"stream_codec_tag", NULL, OFFSET(stream_codec_tag), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"sc_threshold", "scene change threshold", OFFSET(scenechange_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"sc_threshold", "scene change threshold", OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"lmin", "min lagrange factor (VBR)", OFFSET(lmin), FF_OPT_TYPE_INT, {.dbl = 2*FF_QP2LAMBDA }, 0, INT_MAX, V|E}, {"lmin", "min lagrange factor (VBR)", OFFSET(lmin), AV_OPT_TYPE_INT, {.dbl = 2*FF_QP2LAMBDA }, 0, INT_MAX, V|E},
{"lmax", "max lagrange factor (VBR)", OFFSET(lmax), FF_OPT_TYPE_INT, {.dbl = 31*FF_QP2LAMBDA }, 0, INT_MAX, V|E}, {"lmax", "max lagrange factor (VBR)", OFFSET(lmax), AV_OPT_TYPE_INT, {.dbl = 31*FF_QP2LAMBDA }, 0, INT_MAX, V|E},
{"nr", "noise reduction", OFFSET(noise_reduction), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"inter_threshold", NULL, OFFSET(inter_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"inter_threshold", NULL, OFFSET(inter_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"flags2", NULL, OFFSET(flags2), FF_OPT_TYPE_FLAGS, {.dbl = CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_BIT_RESERVOIR|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE }, 0, UINT_MAX, V|A|E|D, "flags2"}, {"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_BIT_RESERVOIR|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE }, 0, UINT_MAX, V|A|E|D, "flags2"},
{"error", NULL, OFFSET(error_rate), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
#if FF_API_ANTIALIAS_ALGO #if FF_API_ANTIALIAS_ALGO
{"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D, "aa"}, {"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D, "aa"},
{"auto", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_AA_AUTO }, INT_MIN, INT_MAX, V|D, "aa"}, {"auto", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_AUTO }, INT_MIN, INT_MAX, V|D, "aa"},
{"fastint", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_AA_FASTINT }, INT_MIN, INT_MAX, V|D, "aa"}, {"fastint", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FASTINT }, INT_MIN, INT_MAX, V|D, "aa"},
{"int", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_AA_INT }, INT_MIN, INT_MAX, V|D, "aa"}, {"int", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_INT }, INT_MIN, INT_MAX, V|D, "aa"},
{"float", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, V|D, "aa"}, {"float", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, V|D, "aa"},
#endif #endif
{"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"threads", NULL, OFFSET(thread_count), FF_OPT_TYPE_INT, {.dbl = 1 }, INT_MIN, INT_MAX, V|E|D}, {"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 1 }, INT_MIN, INT_MAX, V|E|D},
{"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"dc", "intra_dc_precision", OFFSET(intra_dc_precision), FF_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E}, {"dc", "intra_dc_precision", OFFSET(intra_dc_precision), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E},
{"nssew", "nsse weight", OFFSET(nsse_weight), FF_OPT_TYPE_INT, {.dbl = 8 }, INT_MIN, INT_MAX, V|E}, {"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.dbl = 8 }, INT_MIN, INT_MAX, V|E},
{"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D},
{"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D},
{"profile", NULL, OFFSET(profile), FF_OPT_TYPE_INT, {.dbl = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "profile"}, {"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.dbl = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "profile"},
{"unknown", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "profile"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "profile"},
{"aac_main", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_MAIN }, INT_MIN, INT_MAX, A|E, "profile"}, {"aac_main", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_MAIN }, INT_MIN, INT_MAX, A|E, "profile"},
{"aac_low", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LOW }, INT_MIN, INT_MAX, A|E, "profile"}, {"aac_low", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LOW }, INT_MIN, INT_MAX, A|E, "profile"},
{"aac_ssr", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_SSR }, INT_MIN, INT_MAX, A|E, "profile"}, {"aac_ssr", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_SSR }, INT_MIN, INT_MAX, A|E, "profile"},
{"aac_ltp", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LTP }, INT_MIN, INT_MAX, A|E, "profile"}, {"aac_ltp", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_AAC_LTP }, INT_MIN, INT_MAX, A|E, "profile"},
{"dts", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS }, INT_MIN, INT_MAX, A|E, "profile"},
{"dts_es", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_ES }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts_es", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_ES }, INT_MIN, INT_MAX, A|E, "profile"},
{"dts_96_24", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_96_24 }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts_96_24", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_96_24 }, INT_MIN, INT_MAX, A|E, "profile"},
{"dts_hd_hra", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_HD_HRA }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts_hd_hra", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_HD_HRA }, INT_MIN, INT_MAX, A|E, "profile"},
{"dts_hd_ma", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_HD_MA }, INT_MIN, INT_MAX, A|E, "profile"}, {"dts_hd_ma", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_PROFILE_DTS_HD_MA }, INT_MIN, INT_MAX, A|E, "profile"},
{"level", NULL, OFFSET(level), FF_OPT_TYPE_INT, {.dbl = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"}, {"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.dbl = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"},
{"unknown", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"},
{"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|A|D}, {"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|A|D},
{"skip_threshold", "frame skip threshold", OFFSET(frame_skip_threshold), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"skip_threshold", "frame skip threshold", OFFSET(frame_skip_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"skip_factor", "frame skip factor", OFFSET(frame_skip_factor), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"skip_factor", "frame skip factor", OFFSET(frame_skip_factor), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"skip_exp", "frame skip exponent", OFFSET(frame_skip_exp), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"skip_exp", "frame skip exponent", OFFSET(frame_skip_exp), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
{"skipcmp", "frame skip compare function", OFFSET(frame_skip_cmp), FF_OPT_TYPE_INT, {.dbl = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, "cmp_func"}, {"skipcmp", "frame skip compare function", OFFSET(frame_skip_cmp), AV_OPT_TYPE_INT, {.dbl = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, "cmp_func"},
{"border_mask", "increases the quantizer for macroblocks close to borders", OFFSET(border_masking), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, {"border_mask", "increases the quantizer for macroblocks close to borders", OFFSET(border_masking), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E},
{"mblmin", "min macroblock lagrange factor (VBR)", OFFSET(mb_lmin), FF_OPT_TYPE_INT, {.dbl = FF_QP2LAMBDA * 2 }, 1, FF_LAMBDA_MAX, V|E}, {"mblmin", "min macroblock lagrange factor (VBR)", OFFSET(mb_lmin), AV_OPT_TYPE_INT, {.dbl = FF_QP2LAMBDA * 2 }, 1, FF_LAMBDA_MAX, V|E},
{"mblmax", "max macroblock lagrange factor (VBR)", OFFSET(mb_lmax), FF_OPT_TYPE_INT, {.dbl = FF_QP2LAMBDA * 31 }, 1, FF_LAMBDA_MAX, V|E}, {"mblmax", "max macroblock lagrange factor (VBR)", OFFSET(mb_lmax), AV_OPT_TYPE_INT, {.dbl = FF_QP2LAMBDA * 31 }, 1, FF_LAMBDA_MAX, V|E},
{"mepc", "motion estimation bitrate penalty compensation (1.0 = 256)", OFFSET(me_penalty_compensation), FF_OPT_TYPE_INT, {.dbl = 256 }, INT_MIN, INT_MAX, V|E}, {"mepc", "motion estimation bitrate penalty compensation (1.0 = 256)", OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.dbl = 256 }, INT_MIN, INT_MAX, V|E},
{"skip_loop_filter", NULL, OFFSET(skip_loop_filter), FF_OPT_TYPE_INT, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"skip_loop_filter", NULL, OFFSET(skip_loop_filter), AV_OPT_TYPE_INT, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"skip_idct" , NULL, OFFSET(skip_idct) , FF_OPT_TYPE_INT, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"skip_idct" , NULL, OFFSET(skip_idct) , AV_OPT_TYPE_INT, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"skip_frame" , NULL, OFFSET(skip_frame) , FF_OPT_TYPE_INT, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"skip_frame" , NULL, OFFSET(skip_frame) , AV_OPT_TYPE_INT, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"none" , NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AVDISCARD_NONE }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"none" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_NONE }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"default" , NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"default" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"noref" , NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AVDISCARD_NONREF }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"noref" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_NONREF }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"bidir" , NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AVDISCARD_BIDIR }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"bidir" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_BIDIR }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"nokey" , NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AVDISCARD_NONKEY }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"nokey" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_NONKEY }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"all" , NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AVDISCARD_ALL }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"all" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_ALL }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), FF_OPT_TYPE_INT, {.dbl = 1 }, 0, 4, V|E}, {"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), AV_OPT_TYPE_INT, {.dbl = 1 }, 0, 4, V|E},
{"brd_scale", "downscales frames for dynamic B-frame decision", OFFSET(brd_scale), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 10, V|E}, {"brd_scale", "downscales frames for dynamic B-frame decision", OFFSET(brd_scale), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 10, V|E},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"crf", "enables constant quality mode, and selects the quality (x264/VP8)", OFFSET(crf), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 63, V|E}, {"crf", "enables constant quality mode, and selects the quality (x264/VP8)", OFFSET(crf), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 63, V|E},
{"cqp", "constant quantization parameter rate control method", OFFSET(cqp), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E}, {"cqp", "constant quantization parameter rate control method", OFFSET(cqp), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E},
#endif #endif
{"keyint_min", "minimum interval between IDR-frames", OFFSET(keyint_min), FF_OPT_TYPE_INT, {.dbl = 25 }, INT_MIN, INT_MAX, V|E}, {"keyint_min", "minimum interval between IDR-frames", OFFSET(keyint_min), AV_OPT_TYPE_INT, {.dbl = 25 }, INT_MIN, INT_MAX, V|E},
{"refs", "reference frames to consider for motion compensation", OFFSET(refs), FF_OPT_TYPE_INT, {.dbl = 1 }, INT_MIN, INT_MAX, V|E}, {"refs", "reference frames to consider for motion compensation", OFFSET(refs), AV_OPT_TYPE_INT, {.dbl = 1 }, INT_MIN, INT_MAX, V|E},
{"chromaoffset", "chroma qp offset from luma", OFFSET(chromaoffset), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"chromaoffset", "chroma qp offset from luma", OFFSET(chromaoffset), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"bframebias", "influences how often B-frames are used", OFFSET(bframebias), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"bframebias", "influences how often B-frames are used", OFFSET(bframebias), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
#endif #endif
{"trellis", "rate-distortion optimal quantization", OFFSET(trellis), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"trellis", "rate-distortion optimal quantization", OFFSET(trellis), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"directpred", "direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)", OFFSET(directpred), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E}, {"directpred", "direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)", OFFSET(directpred), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E},
{"bpyramid", "allows B-frames to be used as references for predicting", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BPYRAMID }, INT_MIN, INT_MAX, V|E, "flags2"}, {"bpyramid", "allows B-frames to be used as references for predicting", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BPYRAMID }, INT_MIN, INT_MAX, V|E, "flags2"},
{"wpred", "weighted biprediction for b-frames (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"}, {"wpred", "weighted biprediction for b-frames (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"},
{"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, INT_MAX, V|E, "flags2"}, {"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, INT_MAX, V|E, "flags2"},
{"dct8x8", "high profile 8x8 transform (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_8X8DCT }, INT_MIN, INT_MAX, V|E, "flags2"}, {"dct8x8", "high profile 8x8 transform (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_8X8DCT }, INT_MIN, INT_MAX, V|E, "flags2"},
{"fastpskip", "fast pskip (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FASTPSKIP }, INT_MIN, INT_MAX, V|E, "flags2"}, {"fastpskip", "fast pskip (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FASTPSKIP }, INT_MIN, INT_MAX, V|E, "flags2"},
{"aud", "access unit delimiters (H.264)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"aud", "access unit delimiters (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif #endif
{"skiprd", "RD optimal MB level residual skipping", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"skiprd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), FF_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E}, {"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E},
{"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E}, {"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E},
{"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E}, {"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E},
{"partitions", "macroblock subpartition sizes to consider", OFFSET(partitions), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "partitions"}, {"partitions", "macroblock subpartition sizes to consider", OFFSET(partitions), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "partitions"},
{"parti4x4", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_I4X4 }, INT_MIN, INT_MAX, V|E, "partitions"}, {"parti4x4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_I4X4 }, INT_MIN, INT_MAX, V|E, "partitions"},
{"parti8x8", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_I8X8 }, INT_MIN, INT_MAX, V|E, "partitions"}, {"parti8x8", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_I8X8 }, INT_MIN, INT_MAX, V|E, "partitions"},
{"partp4x4", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_P4X4 }, INT_MIN, INT_MAX, V|E, "partitions"}, {"partp4x4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_P4X4 }, INT_MIN, INT_MAX, V|E, "partitions"},
{"partp8x8", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_P8X8 }, INT_MIN, INT_MAX, V|E, "partitions"}, {"partp8x8", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_P8X8 }, INT_MIN, INT_MAX, V|E, "partitions"},
{"partb8x8", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = X264_PART_B8X8 }, INT_MIN, INT_MAX, V|E, "partitions"}, {"partb8x8", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_B8X8 }, INT_MIN, INT_MAX, V|E, "partitions"},
#endif #endif
{"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), FF_OPT_TYPE_INT, {.dbl = 6 }, 0, INT_MAX, V|E}, {"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.dbl = 6 }, 0, INT_MAX, V|E},
{"mv0_threshold", NULL, OFFSET(mv0_threshold), FF_OPT_TYPE_INT, {.dbl = 256 }, 0, INT_MAX, V|E}, {"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.dbl = 256 }, 0, INT_MAX, V|E},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"ivlc", "intra vlc table", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_VLC }, INT_MIN, INT_MAX, V|E, "flags2"}, {"ivlc", "intra vlc table", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_VLC }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif #endif
{"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), FF_OPT_TYPE_INT, {.dbl = 40 }, 1, INT_MAX, V|E}, {"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.dbl = 40 }, 1, INT_MAX, V|E},
{"compression_level", NULL, OFFSET(compression_level), FF_OPT_TYPE_INT, {.dbl = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.dbl = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E},
{"min_prediction_order", NULL, OFFSET(min_prediction_order), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
{"max_prediction_order", NULL, OFFSET(max_prediction_order), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
#if FF_API_FLAC_GLOBAL_OPTS #if FF_API_FLAC_GLOBAL_OPTS
{"lpc_coeff_precision", "deprecated, use flac-specific options", OFFSET(lpc_coeff_precision), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|E}, {"lpc_coeff_precision", "deprecated, use flac-specific options", OFFSET(lpc_coeff_precision), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|E},
{"prediction_order_method", "deprecated, use flac-specific options", OFFSET(prediction_order_method), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"prediction_order_method", "deprecated, use flac-specific options", OFFSET(prediction_order_method), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
{"min_partition_order", "deprecated, use flac-specific options", OFFSET(min_partition_order), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"min_partition_order", "deprecated, use flac-specific options", OFFSET(min_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
{"max_partition_order", "deprecated, use flac-specific options", OFFSET(max_partition_order), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"max_partition_order", "deprecated, use flac-specific options", OFFSET(max_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
#endif #endif
{"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), FF_OPT_TYPE_INT64, {.dbl = 0 }, 0, INT64_MAX, V|E}, {"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.dbl = 0 }, 0, INT64_MAX, V|E},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"drop_frame_timecode", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_DROP_FRAME_TIMECODE }, INT_MIN, INT_MAX, V|E, "flags2"}, {"drop_frame_timecode", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_DROP_FRAME_TIMECODE }, INT_MIN, INT_MAX, V|E, "flags2"},
{"non_linear_q", "use non linear quantizer", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_NON_LINEAR_QUANT }, INT_MIN, INT_MAX, V|E, "flags2"}, {"non_linear_q", "use non linear quantizer", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_NON_LINEAR_QUANT }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif #endif
#if FF_API_REQUEST_CHANNELS #if FF_API_REQUEST_CHANNELS
{"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D},
#endif #endif
#if FF_API_DRC_SCALE #if FF_API_DRC_SCALE
{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, {.dbl = 0.0 }, 0.0, 1.0, A|D}, {"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, 0.0, 1.0, A|D},
#endif #endif
#if FF_API_LAME_GLOBAL_OPTS #if FF_API_LAME_GLOBAL_OPTS
{"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BIT_RESERVOIR }, INT_MIN, INT_MAX, A|E, "flags2"}, {"reservoir", "use bit reservoir", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BIT_RESERVOIR }, INT_MIN, INT_MAX, A|E, "flags2"},
#endif #endif
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"mbtree", "use macroblock tree ratecontrol (x264 only)", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MBTREE }, INT_MIN, INT_MAX, V|E, "flags2"}, {"mbtree", "use macroblock tree ratecontrol (x264 only)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MBTREE }, INT_MIN, INT_MAX, V|E, "flags2"},
#endif #endif
{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
{"channel_layout", NULL, OFFSET(channel_layout), FF_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"}, {"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"},
{"request_channel_layout", NULL, OFFSET(request_channel_layout), FF_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|D, "request_channel_layout"}, {"request_channel_layout", NULL, OFFSET(request_channel_layout), AV_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|D, "request_channel_layout"},
{"rc_max_vbv_use", NULL, OFFSET(rc_max_available_vbv_use), FF_OPT_TYPE_FLOAT, {.dbl = 1.0/3 }, 0.0, FLT_MAX, V|E}, {"rc_max_vbv_use", NULL, OFFSET(rc_max_available_vbv_use), AV_OPT_TYPE_FLOAT, {.dbl = 1.0/3 }, 0.0, FLT_MAX, V|E},
{"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use), FF_OPT_TYPE_FLOAT, {.dbl = 3 }, 0.0, FLT_MAX, V|E}, {"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use), AV_OPT_TYPE_FLOAT, {.dbl = 3 }, 0.0, FLT_MAX, V|E},
{"ticks_per_frame", NULL, OFFSET(ticks_per_frame), FF_OPT_TYPE_INT, {.dbl = 1 }, 1, INT_MAX, A|V|E|D}, {"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.dbl = 1 }, 1, INT_MAX, A|V|E|D},
{"color_primaries", NULL, OFFSET(color_primaries), FF_OPT_TYPE_INT, {.dbl = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D}, {"color_primaries", NULL, OFFSET(color_primaries), AV_OPT_TYPE_INT, {.dbl = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D},
{"color_trc", NULL, OFFSET(color_trc), FF_OPT_TYPE_INT, {.dbl = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D}, {"color_trc", NULL, OFFSET(color_trc), AV_OPT_TYPE_INT, {.dbl = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D},
{"colorspace", NULL, OFFSET(colorspace), FF_OPT_TYPE_INT, {.dbl = AVCOL_SPC_UNSPECIFIED }, 1, AVCOL_SPC_NB-1, V|E|D}, {"colorspace", NULL, OFFSET(colorspace), AV_OPT_TYPE_INT, {.dbl = AVCOL_SPC_UNSPECIFIED }, 1, AVCOL_SPC_NB-1, V|E|D},
{"color_range", NULL, OFFSET(color_range), FF_OPT_TYPE_INT, {.dbl = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D}, {"color_range", NULL, OFFSET(color_range), AV_OPT_TYPE_INT, {.dbl = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D},
{"chroma_sample_location", NULL, OFFSET(chroma_sample_location), FF_OPT_TYPE_INT, {.dbl = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D}, {"chroma_sample_location", NULL, OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.dbl = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D},
#if FF_API_X264_GLOBAL_OPTS #if FF_API_X264_GLOBAL_OPTS
{"psy", "use psycho visual optimization", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_PSY }, INT_MIN, INT_MAX, V|E, "flags2"}, {"psy", "use psycho visual optimization", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_PSY }, INT_MIN, INT_MAX, V|E, "flags2"},
{"psy_rd", "specify psycho visual strength", OFFSET(psy_rd), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E}, {"psy_rd", "specify psycho visual strength", OFFSET(psy_rd), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E},
{"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E}, {"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E},
{"aq_mode", "specify aq method", OFFSET(aq_mode), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E}, {"aq_mode", "specify aq method", OFFSET(aq_mode), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E},
{"aq_strength", "specify aq strength", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E}, {"aq_strength", "specify aq strength", OFFSET(aq_strength), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E},
{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {.dbl = 40 }, -1, INT_MAX, V|E}, {"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, {.dbl = 40 }, -1, INT_MAX, V|E},
{"ssim", "ssim will be calculated during encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"}, {"ssim", "ssim will be calculated during encoding", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"},
{"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"}, {"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"},
{"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E}, {"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E},
#endif #endif
{"log_level_offset", "set the log level offset", OFFSET(log_level_offset), FF_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX }, {"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX },
#if FF_API_FLAC_GLOBAL_OPTS #if FF_API_FLAC_GLOBAL_OPTS
{"lpc_type", "deprecated, use flac-specific options", OFFSET(lpc_type), FF_OPT_TYPE_INT, {.dbl = AV_LPC_TYPE_DEFAULT }, AV_LPC_TYPE_DEFAULT, AV_LPC_TYPE_NB-1, A|E}, {"lpc_type", "deprecated, use flac-specific options", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.dbl = AV_LPC_TYPE_DEFAULT }, AV_LPC_TYPE_DEFAULT, AV_LPC_TYPE_NB-1, A|E},
{"none", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_NONE }, INT_MIN, INT_MAX, A|E, "lpc_type"}, {"none", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_NONE }, INT_MIN, INT_MAX, A|E, "lpc_type"},
{"fixed", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, A|E, "lpc_type"}, {"fixed", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, A|E, "lpc_type"},
{"levinson", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, A|E, "lpc_type"}, {"levinson", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, A|E, "lpc_type"},
{"cholesky", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, A|E, "lpc_type"}, {"cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, A|E, "lpc_type"},
{"lpc_passes", "deprecated, use flac-specific options", OFFSET(lpc_passes), FF_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"lpc_passes", "deprecated, use flac-specific options", OFFSET(lpc_passes), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
#endif #endif
{"slices", "number of slices, used in parallelized decoding", OFFSET(slices), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|E}, {"slices", "number of slices, used in parallelized decoding", OFFSET(slices), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|E},
{"thread_type", "select multithreading type", OFFSET(thread_type), FF_OPT_TYPE_FLAGS, {.dbl = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"}, {"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.dbl = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"},
{"slice", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"}, {"slice", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
{"frame", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_THREAD_FRAME }, INT_MIN, INT_MAX, V|E|D, "thread_type"}, {"frame", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_THREAD_FRAME }, INT_MIN, INT_MAX, V|E|D, "thread_type"},
{"audio_service_type", "audio service type", OFFSET(audio_service_type), FF_OPT_TYPE_INT, {.dbl = AV_AUDIO_SERVICE_TYPE_MAIN }, 0, AV_AUDIO_SERVICE_TYPE_NB-1, A|E, "audio_service_type"}, {"audio_service_type", "audio service type", OFFSET(audio_service_type), AV_OPT_TYPE_INT, {.dbl = AV_AUDIO_SERVICE_TYPE_MAIN }, 0, AV_AUDIO_SERVICE_TYPE_NB-1, A|E, "audio_service_type"},
{"ma", "Main Audio Service", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_MAIN }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"ma", "Main Audio Service", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_MAIN }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"ef", "Effects", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_EFFECTS }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"ef", "Effects", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_EFFECTS }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"vi", "Visually Impaired", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"vi", "Visually Impaired", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"hi", "Hearing Impaired", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"hi", "Hearing Impaired", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"di", "Dialogue", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_DIALOGUE }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"di", "Dialogue", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_DIALOGUE }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"co", "Commentary", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_COMMENTARY }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"co", "Commentary", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_COMMENTARY }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"em", "Emergency", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_EMERGENCY }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"em", "Emergency", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_EMERGENCY }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"vo", "Voice Over", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_VOICE_OVER }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"vo", "Voice Over", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_VOICE_OVER }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"ka", "Karaoke", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_KARAOKE }, INT_MIN, INT_MAX, A|E, "audio_service_type"}, {"ka", "Karaoke", 0, AV_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_KARAOKE }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
{"request_sample_fmt", "sample format audio decoders should prefer", OFFSET(request_sample_fmt), FF_OPT_TYPE_INT, {.dbl = AV_SAMPLE_FMT_NONE }, AV_SAMPLE_FMT_NONE, AV_SAMPLE_FMT_NB-1, A|D, "request_sample_fmt"}, {"request_sample_fmt", "sample format audio decoders should prefer", OFFSET(request_sample_fmt), AV_OPT_TYPE_INT, {.dbl = AV_SAMPLE_FMT_NONE }, AV_SAMPLE_FMT_NONE, AV_SAMPLE_FMT_NB-1, A|D, "request_sample_fmt"},
{"u8" , "8-bit unsigned integer", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_U8 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"}, {"u8" , "8-bit unsigned integer", 0, AV_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_U8 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{"s16", "16-bit signed integer", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_S16 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"}, {"s16", "16-bit signed integer", 0, AV_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_S16 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{"s32", "32-bit signed integer", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_S32 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"}, {"s32", "32-bit signed integer", 0, AV_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_S32 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{"flt", "32-bit float", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_FLT }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"}, {"flt", "32-bit float", 0, AV_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_FLT }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{"dbl", "64-bit double", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_DBL }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"}, {"dbl", "64-bit double", 0, AV_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_DBL }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
{NULL}, {NULL},
}; };
@ -523,7 +528,8 @@ static const AVClass av_codec_context_class = {
.option = options, .option = options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
.log_level_offset_offset = OFFSET(log_level_offset), .log_level_offset_offset = OFFSET(log_level_offset),
.opt_find = opt_find, .child_next = codec_child_next,
.child_class_next = codec_child_class_next,
}; };
void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){ void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){

@ -90,7 +90,7 @@ static av_cold void rnd_table_init(void) {
static av_cold void init_noise_samples(void) { static av_cold void init_noise_samples(void) {
int i; int i;
int random_seed = 0; unsigned random_seed = 0;
float delta = 1.0 / 16384.0; float delta = 1.0 / 16384.0;
for (i = 0; i < 128;i++) { for (i = 0; i < 128;i++) {
random_seed = random_seed * 214013 + 2531011; random_seed = random_seed * 214013 + 2531011;

@ -253,6 +253,9 @@ RV30_MC(avg_, 8)
RV30_MC(avg_, 16) RV30_MC(avg_, 16)
av_cold void ff_rv30dsp_init(RV34DSPContext *c, DSPContext* dsp) { av_cold void ff_rv30dsp_init(RV34DSPContext *c, DSPContext* dsp) {
ff_rv34dsp_init(c, dsp);
c->put_pixels_tab[0][ 0] = dsp->put_h264_qpel_pixels_tab[0][0]; c->put_pixels_tab[0][ 0] = dsp->put_h264_qpel_pixels_tab[0][0];
c->put_pixels_tab[0][ 1] = put_rv30_tpel16_mc10_c; c->put_pixels_tab[0][ 1] = put_rv30_tpel16_mc10_c;
c->put_pixels_tab[0][ 2] = put_rv30_tpel16_mc20_c; c->put_pixels_tab[0][ 2] = put_rv30_tpel16_mc20_c;

@ -171,82 +171,6 @@ static av_cold void rv34_init_tables(void)
/** @} */ // vlc group /** @} */ // vlc group
/**
* @name RV30/40 inverse transform functions
* @{
*/
static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block)
{
int i;
for(i = 0; i < 4; i++){
const int z0 = 13*(block[i+8*0] + block[i+8*2]);
const int z1 = 13*(block[i+8*0] - block[i+8*2]);
const int z2 = 7* block[i+8*1] - 17*block[i+8*3];
const int z3 = 17* block[i+8*1] + 7*block[i+8*3];
temp[4*i+0] = z0 + z3;
temp[4*i+1] = z1 + z2;
temp[4*i+2] = z1 - z2;
temp[4*i+3] = z0 - z3;
}
}
/**
* Real Video 3.0/4.0 inverse transform
* Code is almost the same as in SVQ3, only scaling is different.
*/
static void rv34_inv_transform(DCTELEM *block){
int temp[16];
int i;
rv34_row_transform(temp, block);
for(i = 0; i < 4; i++){
const int z0 = 13*(temp[4*0+i] + temp[4*2+i]) + 0x200;
const int z1 = 13*(temp[4*0+i] - temp[4*2+i]) + 0x200;
const int z2 = 7* temp[4*1+i] - 17*temp[4*3+i];
const int z3 = 17* temp[4*1+i] + 7*temp[4*3+i];
block[i*8+0] = (z0 + z3) >> 10;
block[i*8+1] = (z1 + z2) >> 10;
block[i*8+2] = (z1 - z2) >> 10;
block[i*8+3] = (z0 - z3) >> 10;
}
}
/**
* RealVideo 3.0/4.0 inverse transform for DC block
*
* Code is almost the same as rv34_inv_transform()
* but final coefficients are multiplied by 1.5 and have no rounding.
*/
static void rv34_inv_transform_noround(DCTELEM *block){
int temp[16];
int i;
rv34_row_transform(temp, block);
for(i = 0; i < 4; i++){
const int z0 = 13*(temp[4*0+i] + temp[4*2+i]);
const int z1 = 13*(temp[4*0+i] - temp[4*2+i]);
const int z2 = 7* temp[4*1+i] - 17*temp[4*3+i];
const int z3 = 17* temp[4*1+i] + 7*temp[4*3+i];
block[i*8+0] = ((z0 + z3) * 3) >> 11;
block[i*8+1] = ((z1 + z2) * 3) >> 11;
block[i*8+2] = ((z1 - z2) * 3) >> 11;
block[i*8+3] = ((z0 - z3) * 3) >> 11;
}
}
/** @} */ // transform
/** /**
* @name RV30/40 4x4 block decoding functions * @name RV30/40 4x4 block decoding functions
* @{ * @{
@ -1226,7 +1150,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
memset(block16, 0, sizeof(block16)); memset(block16, 0, sizeof(block16));
rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0); rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0);
rv34_dequant4x4_16x16(block16, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]); rv34_dequant4x4_16x16(block16, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]);
rv34_inv_transform_noround(block16); r->rdsp.rv34_inv_transform_tab[1](block16);
} }
for(i = 0; i < 16; i++, cbp >>= 1){ for(i = 0; i < 16; i++, cbp >>= 1){
@ -1238,7 +1162,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
rv34_dequant4x4(s->block[blknum] + blkoff, rv34_qscale_tab[s->qscale],rv34_qscale_tab[s->qscale]); rv34_dequant4x4(s->block[blknum] + blkoff, rv34_qscale_tab[s->qscale],rv34_qscale_tab[s->qscale]);
if(r->is16) //FIXME: optimize if(r->is16) //FIXME: optimize
s->block[blknum][blkoff] = block16[(i & 3) | ((i & 0xC) << 1)]; s->block[blknum][blkoff] = block16[(i & 3) | ((i & 0xC) << 1)];
rv34_inv_transform(s->block[blknum] + blkoff); r->rdsp.rv34_inv_transform_tab[0](s->block[blknum] + blkoff);
} }
if(r->block_type == RV34_MB_P_MIX16x16) if(r->block_type == RV34_MB_P_MIX16x16)
r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1); r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
@ -1248,7 +1172,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
blkoff = ((i & 1) << 2) + ((i & 2) << 4); blkoff = ((i & 1) << 2) + ((i & 2) << 4);
rv34_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->chroma_vlc, 1); rv34_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->chroma_vlc, 1);
rv34_dequant4x4(s->block[blknum] + blkoff, rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]],rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]]); rv34_dequant4x4(s->block[blknum] + blkoff, rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]],rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]]);
rv34_inv_transform(s->block[blknum] + blkoff); r->rdsp.rv34_inv_transform_tab[0](s->block[blknum] + blkoff);
} }
if (IS_INTRA(s->current_picture_ptr->f.mb_type[mb_pos])) if (IS_INTRA(s->current_picture_ptr->f.mb_type[mb_pos]))
rv34_output_macroblock(r, intra_types, cbp2, r->is16); rv34_output_macroblock(r, intra_types, cbp2, r->is16);

@ -0,0 +1,106 @@
/*
* RV30/40 decoder common dsp functions
* Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
* Copyright (c) 2011 Janne Grunau
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* RV30/40 decoder common dsp functions
*/
#include "dsputil.h"
#include "rv34dsp.h"
/**
* @name RV30/40 inverse transform functions
* @{
*/
static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block)
{
int i;
for(i = 0; i < 4; i++){
const int z0 = 13*(block[i+8*0] + block[i+8*2]);
const int z1 = 13*(block[i+8*0] - block[i+8*2]);
const int z2 = 7* block[i+8*1] - 17*block[i+8*3];
const int z3 = 17* block[i+8*1] + 7*block[i+8*3];
temp[4*i+0] = z0 + z3;
temp[4*i+1] = z1 + z2;
temp[4*i+2] = z1 - z2;
temp[4*i+3] = z0 - z3;
}
}
/**
* Real Video 3.0/4.0 inverse transform
* Code is almost the same as in SVQ3, only scaling is different.
*/
static void rv34_inv_transform_c(DCTELEM *block){
int temp[16];
int i;
rv34_row_transform(temp, block);
for(i = 0; i < 4; i++){
const int z0 = 13*(temp[4*0+i] + temp[4*2+i]) + 0x200;
const int z1 = 13*(temp[4*0+i] - temp[4*2+i]) + 0x200;
const int z2 = 7* temp[4*1+i] - 17*temp[4*3+i];
const int z3 = 17* temp[4*1+i] + 7*temp[4*3+i];
block[i*8+0] = (z0 + z3) >> 10;
block[i*8+1] = (z1 + z2) >> 10;
block[i*8+2] = (z1 - z2) >> 10;
block[i*8+3] = (z0 - z3) >> 10;
}
}
/**
* RealVideo 3.0/4.0 inverse transform for DC block
*
* Code is almost the same as rv34_inv_transform()
* but final coefficients are multiplied by 1.5 and have no rounding.
*/
static void rv34_inv_transform_noround_c(DCTELEM *block){
int temp[16];
int i;
rv34_row_transform(temp, block);
for(i = 0; i < 4; i++){
const int z0 = 13*(temp[4*0+i] + temp[4*2+i]);
const int z1 = 13*(temp[4*0+i] - temp[4*2+i]);
const int z2 = 7* temp[4*1+i] - 17*temp[4*3+i];
const int z3 = 17* temp[4*1+i] + 7*temp[4*3+i];
block[i*8+0] = ((z0 + z3) * 3) >> 11;
block[i*8+1] = ((z1 + z2) * 3) >> 11;
block[i*8+2] = ((z1 - z2) * 3) >> 11;
block[i*8+3] = ((z0 - z3) * 3) >> 11;
}
}
/** @} */ // transform
av_cold void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp) {
c->rv34_inv_transform_tab[0] = rv34_inv_transform_c;
c->rv34_inv_transform_tab[1] = rv34_inv_transform_noround_c;
}

@ -34,15 +34,19 @@ typedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/,
uint8_t *src2/*align width (8 or 16)*/, uint8_t *src2/*align width (8 or 16)*/,
int w1, int w2, int stride); int w1, int w2, int stride);
typedef void (*rv34_inv_transform_func)(DCTELEM *block);
typedef struct RV34DSPContext { typedef struct RV34DSPContext {
qpel_mc_func put_pixels_tab[4][16]; qpel_mc_func put_pixels_tab[4][16];
qpel_mc_func avg_pixels_tab[4][16]; qpel_mc_func avg_pixels_tab[4][16];
h264_chroma_mc_func put_chroma_pixels_tab[3]; h264_chroma_mc_func put_chroma_pixels_tab[3];
h264_chroma_mc_func avg_chroma_pixels_tab[3]; h264_chroma_mc_func avg_chroma_pixels_tab[3];
rv40_weight_func rv40_weight_pixels_tab[2]; rv40_weight_func rv40_weight_pixels_tab[2];
rv34_inv_transform_func rv34_inv_transform_tab[2];
} RV34DSPContext; } RV34DSPContext;
void ff_rv30dsp_init(RV34DSPContext *c, DSPContext* dsp); void ff_rv30dsp_init(RV34DSPContext *c, DSPContext* dsp);
void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp);
void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp); void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp);
void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp); void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp);

@ -295,6 +295,9 @@ RV40_WEIGHT_FUNC(16)
RV40_WEIGHT_FUNC(8) RV40_WEIGHT_FUNC(8)
av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) { av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
ff_rv34dsp_init(c, dsp);
c->put_pixels_tab[0][ 0] = dsp->put_h264_qpel_pixels_tab[0][0]; c->put_pixels_tab[0][ 0] = dsp->put_h264_qpel_pixels_tab[0][0];
c->put_pixels_tab[0][ 1] = put_rv40_qpel16_mc10_c; c->put_pixels_tab[0][ 1] = put_rv40_qpel16_mc10_c;
c->put_pixels_tab[0][ 2] = dsp->put_h264_qpel_pixels_tab[0][2]; c->put_pixels_tab[0][ 2] = dsp->put_h264_qpel_pixels_tab[0][2];

@ -3682,7 +3682,7 @@ static av_cold int encode_end(AVCodecContext *avctx)
#define OFFSET(x) offsetof(SnowContext, x) #define OFFSET(x) offsetof(SnowContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "memc_only", "Only do ME/MC (I frames -> ref, P frame -> ME+MC).", OFFSET(memc_only), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { "memc_only", "Only do ME/MC (I frames -> ref, P frame -> ME+MC).", OFFSET(memc_only), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
{ NULL }, { NULL },
}; };

@ -133,10 +133,10 @@ enum TransformTypes {
TT_8X8, TT_8X8,
TT_8X4_BOTTOM, TT_8X4_BOTTOM,
TT_8X4_TOP, TT_8X4_TOP,
TT_8X4, //Both halves TT_8X4, // both halves
TT_4X8_RIGHT, TT_4X8_RIGHT,
TT_4X8_LEFT, TT_4X8_LEFT,
TT_4X8, //Both halves TT_4X8, // both halves
TT_4X4 TT_4X4
}; };
//@} //@}
@ -394,7 +394,8 @@ static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, cons
{ {
uint32_t mrk = 0xFFFFFFFF; uint32_t mrk = 0xFFFFFFFF;
if(end-src < 4) return end; if (end-src < 4)
return end;
while (src < end) { while (src < end) {
mrk = (mrk << 8) | *src++; mrk = (mrk << 8) | *src++;
if (IS_MARKER(mrk)) if (IS_MARKER(mrk))
@ -408,7 +409,8 @@ static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, ui
int dsize = 0, i; int dsize = 0, i;
if (size < 4) { if (size < 4) {
for(dsize = 0; dsize < size; dsize++) *dst++ = *src++; for (dsize = 0; dsize < size; dsize++)
*dst++ = *src++;
return size; return size;
} }
for (i = 0; i < size; i++, src++) { for (i = 0; i < size; i++, src++) {

@ -62,7 +62,8 @@ const uint8_t ff_vc1_mbmode_intfrp[2][15][4] = {
{ MV_PMODE_INTFR_2MV_FIELD, 0, 0, 1 }, { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 1 },
{ MV_PMODE_INTFR_2MV_FIELD, 1, 0, 1 }, { MV_PMODE_INTFR_2MV_FIELD, 1, 0, 1 },
{ MV_PMODE_INTFR_2MV_FIELD, 0, 0, 0 }, { MV_PMODE_INTFR_2MV_FIELD, 0, 0, 0 },
{ MV_PMODE_INTFR_INTRA , 0, 0, 0} }, { MV_PMODE_INTFR_INTRA , 0, 0, 0 }
},
{ {
/* Table 160 - Table 163 */ /* Table 160 - Table 163 */
{ MV_PMODE_INTFR_1MV , 0, 1, 1 }, { MV_PMODE_INTFR_1MV , 0, 1, 1 },
@ -86,18 +87,15 @@ const uint8_t ff_vc1_mbmode_intfrp[2][15][4] = {
const int ff_vc1_fps_nr[5] = { 24, 25, 30, 50, 60 }, const int ff_vc1_fps_nr[5] = { 24, 25, 30, 50, 60 },
ff_vc1_fps_dr[2] = { 1000, 1001 }; ff_vc1_fps_dr[2] = { 1000, 1001 };
const uint8_t ff_vc1_pquant_table[3][32] = { const uint8_t ff_vc1_pquant_table[3][32] = {
{ /* Implicit quantizer */ /* Implicit quantizer */
0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 12, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 29, 31 },
}, /* Explicit quantizer, pquantizer uniform */
{ /* Explicit quantizer, pquantizer uniform */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 },
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 /* Explicit quantizer, pquantizer non-uniform */
}, { 0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
{ /* Explicit quantizer, pquantizer non-uniform */ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31 }
0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 31
}
}; };
/** @name VC-1 VLC tables and defines /** @name VC-1 VLC tables and defines
@ -343,188 +341,313 @@ const uint8_t ff_vc1_if_1mv_mbmode_bits[8][6] = {
/* 1-reference tables */ /* 1-reference tables */
const uint32_t ff_vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */ const uint32_t ff_vc1_1ref_mvdata_codes[4][72] = { /* uint32_t may be too big */
{5, 12, 30, 18, 12, 52, 117, 112, 0, 8, 27, 8, 29, 124, 214, 478, 431, 5, 27, 38, 30, 18, 118, 77, {
502, 500, 57, 127, 39, 106, 113, 53, 113, 104, 476, 39, 115, 255, 232, 233, 126, 505, 501, 509, 62, 458, 1017, 76, 0x00005, 0x0000C, 0x0001E, 0x00012, 0x0000C, 0x00034, 0x00075, 0x00070,
105, 506, 479, 503, 112, 477, 3661, 1831, 914, 456, 459, 1016, 430, 504, 507, 58574, 58575, 29280, 29281, 29282, 29283, 29284, 29285, 29286}, 0x00000, 0x00008, 0x0001B, 0x00008, 0x0001D, 0x0007C, 0x000D6, 0x001DE,
{7, 1, 7, 22, 1, 69, 24, 694, 6, 4, 23, 16, 41, 44, 346, 102, 414, 9, 40, 23, 0, 42, 4, 91, 0x001AF, 0x00005, 0x0001B, 0x00026, 0x0001E, 0x00012, 0x00076, 0x0004D,
181, 206, 6, 68, 15, 70, 14, 172, 50, 55, 4587, 10, 26, 287, 22, 20, 43, 360, 85, 9173, 87, 47, 54, 46, 0x001F6, 0x001F4, 0x00039, 0x0007F, 0x00027, 0x0006A, 0x00071, 0x00035,
361, 84, 1147, 415, 11133, 142, 2782, 1145, 1390, 2292, 5567, 1144, 9172, 44529, 22265, 712462, 712463, 356224, 356225, 356226, 356227, 356228, 356229, 356230}, 0x00071, 0x00068, 0x001DC, 0x00027, 0x00073, 0x000FF, 0x000E8, 0x000E9,
{2, 6, 7, 13, 7, 48, 255, 496, 2, 0, 5, 25, 30, 7, 99, 253, 35, 14, 27, 26, 6, 9, 24, 197, 0x0007E, 0x001F9, 0x001F5, 0x001FD, 0x0003E, 0x001CA, 0x003F9, 0x0004C,
51, 497, 2, 1019, 499, 34, 508, 66, 1571, 131, 1568, 125, 64, 67, 996, 997, 401, 4073, 261, 520, 252, 1572, 1570, 400, 0x00069, 0x001FA, 0x001DF, 0x001F7, 0x00070, 0x001DD, 0x00E4D, 0x00727,
1574, 2037, 3147, 8144, 4173, 101, 3138, 201, 1575, 3139, 3146, 4174, 8145, 4175, 1042, 66766, 66767, 33376, 33377, 33378, 33379, 33380, 33381, 33382}, 0x00392, 0x001C8, 0x001CB, 0x003F8, 0x001AE, 0x001F8, 0x001FB, 0x0E4CE,
{13, 1, 4, 0, 23, 5, 127, 77, 3, 17, 62, 59, 23, 103, 74, 195, 242, 10, 44, 50, 61, 21, 40, 147, 0x0E4CF, 0x07260, 0x07261, 0x07262, 0x07263, 0x07264, 0x07265, 0x07266
204, 150, 3, 117, 32, 45, 33, 41, 144, 464, 507, 28, 76, 96, 9, 8, 45, 159, 506, 317, 49, 252, 88, 146, },
240, 241, 205, 389, 357, 78, 145, 233, 388, 465, 486, 151, 487, 179, 316, 5710, 5711, 2848, 2849, 2850, 2851, 2852, 2853, 2854} {
0x00007, 0x00001, 0x00007, 0x00016, 0x00001, 0x00045, 0x00018, 0x002B6,
0x00006, 0x00004, 0x00017, 0x00010, 0x00029, 0x0002C, 0x0015A, 0x00066,
0x0019E, 0x00009, 0x00028, 0x00017, 0x00000, 0x0002A, 0x00004, 0x0005B,
0x000B5, 0x000CE, 0x00006, 0x00044, 0x0000F, 0x00046, 0x0000E, 0x000AC,
0x00032, 0x00037, 0x011EB, 0x0000A, 0x0001A, 0x0011F, 0x00016, 0x00014,
0x0002B, 0x00168, 0x00055, 0x023D5, 0x00057, 0x0002F, 0x00036, 0x0002E,
0x00169, 0x00054, 0x0047B, 0x0019F, 0x02B7D, 0x0008E, 0x00ADE, 0x00479,
0x0056E, 0x008F4, 0x015BF, 0x00478, 0x023D4, 0x0ADF1, 0x056F9, 0xADF0E,
0xADF0F, 0x56F80, 0x56F81, 0x56F82, 0x56F83, 0x56F84, 0x56F85, 0x56F86
},
{
0x00002, 0x00006, 0x00007, 0x0000D, 0x00007, 0x00030, 0x000FF, 0x001F0,
0x00002, 0x00000, 0x00005, 0x00019, 0x0001E, 0x00007, 0x00063, 0x000FD,
0x00023, 0x0000E, 0x0001B, 0x0001A, 0x00006, 0x00009, 0x00018, 0x000C5,
0x00033, 0x001F1, 0x00002, 0x003FB, 0x001F3, 0x00022, 0x001FC, 0x00042,
0x00623, 0x00083, 0x00620, 0x0007D, 0x00040, 0x00043, 0x003E4, 0x003E5,
0x00191, 0x00FE9, 0x00105, 0x00208, 0x000FC, 0x00624, 0x00622, 0x00190,
0x00626, 0x007F5, 0x00C4B, 0x01FD0, 0x0104D, 0x00065, 0x00C42, 0x000C9,
0x00627, 0x00C43, 0x00C4A, 0x0104E, 0x01FD1, 0x0104F, 0x00412, 0x104CE,
0x104CF, 0x08260, 0x08261, 0x08262, 0x08263, 0x08264, 0x08265, 0x08266
},
{
0x0000D, 0x00001, 0x00004, 0x00000, 0x00017, 0x00005, 0x0007F, 0x0004D,
0x00003, 0x00011, 0x0003E, 0x0003B, 0x00017, 0x00067, 0x0004A, 0x000C3,
0x000F2, 0x0000A, 0x0002C, 0x00032, 0x0003D, 0x00015, 0x00028, 0x00093,
0x000CC, 0x00096, 0x00003, 0x00075, 0x00020, 0x0002D, 0x00021, 0x00029,
0x00090, 0x001D0, 0x001FB, 0x0001C, 0x0004C, 0x00060, 0x00009, 0x00008,
0x0002D, 0x0009F, 0x001FA, 0x0013D, 0x00031, 0x000FC, 0x00058, 0x00092,
0x000F0, 0x000F1, 0x000CD, 0x00185, 0x00165, 0x0004E, 0x00091, 0x000E9,
0x00184, 0x001D1, 0x001E6, 0x00097, 0x001E7, 0x000B3, 0x0013C, 0x0164E,
0x0164F, 0x00B20, 0x00B21, 0x00B22, 0x00B23, 0x00B24, 0x00B25, 0x00B26
}
}; };
const uint8_t ff_vc1_1ref_mvdata_bits[4][72] = { const uint8_t ff_vc1_1ref_mvdata_bits[4][72] = {
{3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4, 6, 6, 6, 6, 7, 8, {
9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6, 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 3, 4, 5, 5, 5, 6, 7, 7, 2, 4, 5, 5, 6, 7, 8, 9, 9, 4,
8, 9, 9, 9, 8, 9, 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16}, 6, 6, 6, 6, 7, 8, 9, 9, 6, 8, 7, 7, 7, 7, 8, 8, 9, 6,
{3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4, 6, 6, 5, 6, 6, 8, 8, 8, 8, 8, 8, 9, 9, 9, 7, 10, 10, 8, 8, 9, 9, 9, 8, 9,
9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5, 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 13, 12, 11, 10, 10, 10, 9, 9, 9, 17, 17, 16, 16, 16, 16, 16, 16, 16
10, 10, 11, 12, 14, 8, 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19}, },
{3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4, 7, 7, 6, 6, 7, 8, {
8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7, 9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 3, 3, 4, 5, 5, 7, 8, 10, 3, 4, 5, 5, 6, 7, 9, 10, 12, 4,
11, 11, 12, 13, 15, 9, 12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18}, 6, 6, 5, 6, 6, 8, 9, 11, 4, 7, 7, 7, 7, 8, 9, 9, 13, 5,
{4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4, 6, 6, 6, 6, 7, 8, 8, 9, 8, 8, 9, 10, 10, 14, 7, 9, 9, 9, 10, 10, 11, 12, 14, 8,
8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5, 7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 12, 11, 11, 12, 13, 11, 14, 16, 15, 20, 20, 19, 19, 19, 19, 19, 19, 19
8, 8, 8, 9, 10, 7, 8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13} },
{
3, 4, 4, 4, 5, 6, 8, 9, 2, 4, 5, 5, 5, 6, 7, 8, 8, 4,
7, 7, 6, 6, 7, 8, 8, 9, 5, 10, 9, 8, 9, 9, 11, 10, 11, 7,
9, 9, 10, 10, 11, 12, 11, 12, 8, 11, 11, 11, 11, 11, 12, 13, 15, 9,
12, 10, 11, 12, 12, 15, 13, 15, 13, 19, 19, 18, 18, 18, 18, 18, 18, 18
},
{
4, 4, 4, 4, 5, 5, 7, 7, 3, 5, 6, 6, 6, 7, 7, 8, 8, 4,
6, 6, 6, 6, 7, 8, 8, 8, 4, 7, 6, 6, 6, 7, 8, 9, 9, 5,
7, 7, 6, 6, 7, 8, 9, 9, 6, 8, 8, 8, 8, 8, 8, 9, 10, 7,
8, 8, 9, 9, 9, 8, 9, 9, 9, 14, 14, 13, 13, 13, 13, 13, 13, 13
}
}; };
/* 2-reference tables */ /* 2-reference tables */
const uint32_t ff_vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */ const uint32_t ff_vc1_2ref_mvdata_codes[8][126] = { /* table 132 - table 139 */
{12, 28, 11, 0, 14, 42, 80, 872, 2, 26, 4, 58, 29, 108, {
239, 444, 351, 15, 3, 28, 13, 11, 62, 167, 326, 409, 6, 31, 0x0000C, 0x0001C, 0x0000B, 0x00000, 0x0000E, 0x0002A, 0x00050, 0x00368,
4, 60, 7, 446, 139, 44, 1971, 5, 219, 86, 236, 82, 445, 120, 0x00002, 0x0001A, 0x00004, 0x0003A, 0x0001D, 0x0006C, 0x000EF, 0x001BC,
207, 1395, 9, 35, 237, 24, 6, 68, 245, 121, 1746, 110, 43, 349, 0x0015F, 0x0000F, 0x00003, 0x0001C, 0x0000D, 0x0000B, 0x0003E, 0x000A7,
23, 895, 324, 206, 40, 171, 16, 437, 247, 166, 123, 40, 493, 489, 0x00146, 0x00199, 0x00006, 0x0001F, 0x00004, 0x0003C, 0x00007, 0x001BE,
1789, 4, 245, 41, 650, 651, 655, 3577, 821, 7813, 238, 701, 43, 984, 0x0008B, 0x0002C, 0x007B3, 0x00005, 0x000DB, 0x00056, 0x000EC, 0x00052,
977, 408, 489, 1309, 180, 63, 1109, 555, 553, 1105, 1400, 1970, 1392, 341, 0x001BD, 0x00078, 0x000CF, 0x00573, 0x00009, 0x00023, 0x000ED, 0x00018,
50, 976, 84, 1747, 1393, 1108, 820, 7153, 183, 41, 7812, 364, 411, 7152, 0x00006, 0x00044, 0x000F5, 0x00079, 0x006D2, 0x0006E, 0x0002B, 0x0015D,
1401, 3907, 181, 2209, 42, 365, 2208, 1952, 977, 2789, 340, 2788, 2617, 2616}, 0x00017, 0x0037F, 0x00144, 0x000CE, 0x00028, 0x000AB, 0x00010, 0x001B5,
{3, 9, 22, 16, 215, 821, 1396, 1365, 0, 29, 9, 23, 44, 173, 0x000F7, 0x000A6, 0x0007B, 0x00028, 0x001ED, 0x001E9, 0x006FD, 0x00004,
884, 1715, 1399, 15, 24, 10, 46, 34, 380, 3707, 7049, 5592, 8, 52, 0x000F5, 0x00029, 0x0028A, 0x0028B, 0x0028F, 0x00DF9, 0x00335, 0x01E85,
109, 35, 450, 886, 723, 7242, 13066, 20, 106, 114, 108, 227, 411, 1855, 0x000EE, 0x002BD, 0x0002B, 0x003D8, 0x003D1, 0x00198, 0x001E9, 0x0051D,
7408, 2881, 50, 230, 224, 207, 171, 412, 683, 3627, 5593, 111, 451, 175, 0x000B4, 0x0003F, 0x00455, 0x0022B, 0x00229, 0x00451, 0x00578, 0x007B2,
191, 172, 381, 1763, 3625, 6532, 84, 181, 378, 429, 409, 376, 856, 722, 0x00570, 0x00155, 0x00032, 0x003D0, 0x00054, 0x006D3, 0x00571, 0x00454,
7243, 91, 680, 817, 904, 907, 880, 1811, 3267, 7409, 441, 1519, 1848, 754, 0x00334, 0x01BF1, 0x000B7, 0x00029, 0x01E84, 0x0016C, 0x0019B, 0x01BF0,
827, 697, 1771, 1392, 3620, 925, 1442, 1443, 3709, 1518, 1849, 1364, 2725, 2724, 0x00579, 0x00F43, 0x000B5, 0x008A1, 0x0002A, 0x0016D, 0x008A0, 0x007A0,
887, 7413, 3022, 3705, 1632, 1652, 1770, 3708, 3429, 758, 5594, 7048, 1441, 7412, 0x003D1, 0x00AE5, 0x00154, 0x00AE4, 0x00A39, 0x00A38
1510, 3624, 1397, 3428, 820, 13067, 5595, 2880, 3023, 3525, 3626, 1653, 1393, 1363}, },
{4, 2, 16, 3, 23, 69, 62, 126, 3, 2, 40, 30, 21, 71, {
2, 333, 96, 11, 38, 36, 20, 50, 111, 195, 1329, 1765, 21, 63, 0x00003, 0x00009, 0x00016, 0x00010, 0x000D7, 0x00335, 0x00574, 0x00555,
45, 1, 318, 221, 246, 773, 817, 14, 3, 52, 51, 26, 330, 197, 0x00000, 0x0001D, 0x00009, 0x00017, 0x0002C, 0x000AD, 0x00374, 0x006B3,
244, 1764, 1, 60, 125, 141, 157, 49, 110, 662, 205, 37, 329, 50, 0x00577, 0x0000F, 0x00018, 0x0000A, 0x0002E, 0x00022, 0x0017C, 0x00E7B,
137, 54, 136, 111, 3, 797, 14, 426, 638, 97, 334, 335, 103, 255, 0x01B89, 0x015D8, 0x00008, 0x00034, 0x0006D, 0x00023, 0x001C2, 0x00376,
387, 54, 855, 245, 198, 194, 665, 281, 561, 848, 44, 399, 1328, 663, 0x002D3, 0x01C4A, 0x0330A, 0x00014, 0x0006A, 0x00072, 0x0006C, 0x000E3,
4, 440, 192, 634, 785, 156, 1569, 409, 796, 247, 995, 854, 393, 5, 0x0019B, 0x0073F, 0x01CF0, 0x00B41, 0x00032, 0x000E6, 0x000E0, 0x000CF,
107, 2242, 816, 1279, 1264, 849, 1266, 498, 883, 0, 3137, 2243, 2540, 994, 0x000AB, 0x0019C, 0x002AB, 0x00E2B, 0x015D9, 0x0006F, 0x001C3, 0x000AF,
772, 1271, 1265, 496, 328, 3136, 2541, 2240, 2241, 1267, 1278, 254, 499, 425}, 0x000BF, 0x000AC, 0x0017D, 0x006E3, 0x00E29, 0x01984, 0x00054, 0x000B5,
{0, 4, 47, 82, 16, 173, 1291, 400, 3, 22, 7, 13, 187, 371, 0x0017A, 0x001AD, 0x00199, 0x00178, 0x00358, 0x002D2, 0x01C4B, 0x0005B,
201, 1295, 5932, 3, 17, 5, 67, 35, 75, 814, 11867, 1154, 9, 42, 0x002A8, 0x00331, 0x00388, 0x0038B, 0x00370, 0x00713, 0x00CC3, 0x01CF1,
20, 42, 264, 1482, 1626, 8502, 8498, 11, 19, 65, 184, 372, 256, 5338, 0x001B9, 0x005EF, 0x00738, 0x002F2, 0x0033B, 0x002B9, 0x006EB, 0x00570,
16462, 5175, 43, 133, 167, 160, 332, 666, 812, 8499, 5162, 81, 644, 172, 0x00E24, 0x0039D, 0x005A2, 0x005A3, 0x00E7D, 0x005EE, 0x00739, 0x00554,
258, 69, 68, 2075, 1630, 3255, 24, 1292, 530, 740, 515, 148, 290, 2074, 0x00AA5, 0x00AA4, 0x00377, 0x01CF5, 0x00BCE, 0x00E79, 0x00660, 0x00674,
1621, 51, 698, 582, 578, 2670, 1036, 2056, 8500, 16463, 373, 1029, 583, 298, 0x006EA, 0x00E7C, 0x00D65, 0x002F6, 0x015DA, 0x01B88, 0x005A1, 0x01CF4,
2580, 699, 401, 2127, 5176, 175, 2967, 1155, 5179, 811, 579, 5163, 2392, 10687, 0x005E6, 0x00E28, 0x00575, 0x00D64, 0x00334, 0x0330B, 0x015DB, 0x00B40,
73, 2668, 5339, 1197, 5342, 2126, 5172, 599, 11866, 519, 5173, 5177, 3254, 5178, 0x00BCF, 0x00DC5, 0x00E2A, 0x00675, 0x00571, 0x00553
404, 1620, 8501, 21372, 348, 576, 4114, 21373, 2393, 4248, 5174, 1631, 8230, 8503}, },
{5, 25, 22, 17, 62, 94, 239, 226, 0, 57, 43, 38, 40, 18, {
194, 237, 285, 13, 49, 42, 37, 32, 92, 493, 589, 1904, 6, 122, 0x00004, 0x00002, 0x00010, 0x00003, 0x00017, 0x00045, 0x0003E, 0x0007E,
96, 79, 72, 57, 390, 531, 3782, 15, 38, 95, 117, 112, 39, 475, 0x00003, 0x00002, 0x00028, 0x0001E, 0x00015, 0x00047, 0x00002, 0x0014D,
966, 1935, 63, 166, 240, 58, 82, 78, 227, 473, 783, 16, 477, 167, 0x00060, 0x0000B, 0x00026, 0x00024, 0x00014, 0x00032, 0x0006F, 0x000C3,
247, 34, 146, 964, 751, 1890, 121, 143, 474, 135, 232, 186, 374, 238, 0x00531, 0x006E5, 0x00015, 0x0003F, 0x0002D, 0x00001, 0x0013E, 0x000DD,
944, 133, 281, 782, 264, 466, 268, 1907, 1060, 1076, 113, 1501, 449, 935, 0x000F6, 0x00305, 0x00331, 0x0000E, 0x00003, 0x00034, 0x00033, 0x0001A,
295, 141, 539, 1970, 479, 984, 1892, 3812, 947, 1869, 472, 1500, 2122, 1177, 0x0014A, 0x000C5, 0x000F4, 0x006E4, 0x00001, 0x0003C, 0x0007D, 0x0008D,
965, 7566, 1893, 1077, 1905, 450, 280, 956, 897, 903, 31539, 4247, 4246, 7885, 0x0009D, 0x00031, 0x0006E, 0x00296, 0x000CD, 0x00025, 0x00149, 0x00032,
3737, 3868, 3869, 3813, 284, 31538, 15768, 7567, 3736, 3943, 957, 896, 1176, 902}, 0x00089, 0x00036, 0x00088, 0x0006F, 0x00003, 0x0031D, 0x0000E, 0x001AA,
{13, 16, 46, 57, 13, 116, 237, 182, 1, 2, 0, 48, 41, 112, 0x0027E, 0x00061, 0x0014E, 0x0014F, 0x00067, 0x000FF, 0x00183, 0x00036,
243, 140, 358, 9, 51, 120, 6, 196, 11, 355, 204, 1470, 31, 47, 0x00357, 0x000F5, 0x000C6, 0x000C2, 0x00299, 0x00119, 0x00231, 0x00350,
100, 24, 198, 10, 354, 704, 3827, 7, 15, 227, 202, 178, 399, 942, 0x0002C, 0x0018F, 0x00530, 0x00297, 0x00004, 0x001B8, 0x000C0, 0x0027A,
1887, 3153, 21, 71, 238, 226, 234, 9, 362, 707, 1437, 61, 8, 473, 0x00311, 0x0009C, 0x00621, 0x00199, 0x0031C, 0x000F7, 0x003E3, 0x00356,
50, 14, 366, 812, 1627, 6507, 2, 15, 472, 141, 180, 484, 103, 791, 0x00189, 0x00005, 0x0006B, 0x008C2, 0x00330, 0x004FF, 0x004F0, 0x00351,
1940, 34, 958, 789, 52, 55, 734, 108, 3838, 1644, 40, 971, 940, 53, 0x004F2, 0x001F2, 0x00373, 0x00000, 0x00C41, 0x008C3, 0x009EC, 0x003E2,
363, 957, 705, 1580, 7678, 14, 1438, 1471, 218, 1577, 1412, 3767, 2826, 1645, 0x00304, 0x004F7, 0x004F1, 0x001F0, 0x00148, 0x00C40, 0x009ED, 0x008C0,
12, 1918, 1436, 1912, 1886, 1882, 1581, 823, 820, 407, 7767, 7652, 6506, 7766, 0x008C1, 0x004F3, 0x004FE, 0x000FE, 0x001F3, 0x001A9
3152, 2879, 7764, 2827, 398, 438, 7765, 3252, 2878, 3766, 7653, 7679, 821, 439}, },
{1, 11, 25, 111, 42, 117, 2027, 355, 1, 14, 26, 62, 28, 45, {
356, 2028, 357, 4, 6, 54, 127, 174, 344, 348, 1389, 1037584, 0, 4, 0x00000, 0x00004, 0x0002F, 0x00052, 0x00010, 0x000AD, 0x0050B, 0x00190,
123, 243, 59, 2029, 691, 716, 1390, 24, 62, 23, 30, 175, 1015, 1391, 0x00003, 0x00016, 0x00007, 0x0000D, 0x000BB, 0x00173, 0x000C9, 0x0050F,
717, 1037585, 20, 173, 170, 20, 168, 339, 232, 510, 3535, 120, 440, 338, 0x0172C, 0x00003, 0x00011, 0x00005, 0x00043, 0x00023, 0x0004B, 0x0032E,
254, 689, 349, 352, 1037586, 1037587, 122, 688, 485, 233, 252, 1766, 3528, 1412, 0x02E5B, 0x00482, 0x00009, 0x0002A, 0x00014, 0x0002A, 0x00108, 0x005CA,
1037588, 171, 3550, 345, 1012, 3529, 3530, 506, 1037589, 1037590, 252, 511, 484, 175, 0x0065A, 0x02136, 0x02132, 0x0000B, 0x00013, 0x00041, 0x000B8, 0x00174,
346, 359, 3531, 1413, 1037591, 1015, 16213, 1037592, 3548, 1414, 16214, 1037593, 16215, 1037594, 0x00100, 0x014DA, 0x0404E, 0x01437, 0x0002B, 0x00085, 0x000A7, 0x000A0,
442, 1415, 1416, 3551, 690, 1037595, 3534, 1014, 1037596, 4052, 1037597, 1037598, 1037599, 518784, 0x0014C, 0x0029A, 0x0032C, 0x02133, 0x0142A, 0x00051, 0x00284, 0x000AC,
518785, 1388, 518786, 518787, 886, 1417, 1418, 518788, 518789, 3549, 518790, 518791, 1419, 32425}, 0x00102, 0x00045, 0x00044, 0x0081B, 0x0065E, 0x00CB7, 0x00018, 0x0050C,
{3, 14, 15, 126, 98, 198, 3289, 1598, 2, 2, 0, 24, 12, 105, 0x00212, 0x002E4, 0x00203, 0x00094, 0x00122, 0x0081A, 0x00655, 0x00033,
57, 1799, 3198, 2, 13, 27, 15, 410, 1607, 6711, 214724, 13421, 1, 30, 0x002BA, 0x00246, 0x00242, 0x00A6E, 0x0040C, 0x00808, 0x02134, 0x0404F,
127, 10, 225, 1633, 3300, 214725, 214726, 29, 48, 13, 203, 409, 800, 142, 0x00175, 0x00405, 0x00247, 0x0012A, 0x00A14, 0x002BB, 0x00191, 0x0084F,
25902, 214727, 62, 57, 53, 51, 415, 448, 3290, 214728, 214729, 11, 208, 414, 0x01438, 0x000AF, 0x00B97, 0x00483, 0x0143B, 0x0032B, 0x00243, 0x0142B,
34, 56, 398, 798, 12948, 572, 50, 18, 19, 113, 413, 32, 3207, 3264, 0x00958, 0x029BF, 0x00049, 0x00A6C, 0x014DB, 0x004AD, 0x014DE, 0x0084E,
214730, 824, 1619, 418, 810, 802, 3303, 132, 287, 214731, 805, 1609, 811, 119, 0x01434, 0x00257, 0x02E5A, 0x00207, 0x01435, 0x01439, 0x00CB6, 0x0143A,
1608, 1602, 3206, 3212, 214732, 58, 6583, 67, 807, 140, 141, 3213, 214733, 214734, 0x00194, 0x00654, 0x02135, 0x0537C, 0x0015C, 0x00240, 0x01012, 0x0537D,
823, 3301, 133, 806, 839, 3236, 3199, 3354, 214735, 808, 107360, 107361, 3288, 1676, 0x00959, 0x01098, 0x01436, 0x0065F, 0x02026, 0x02137
12949, 12950, 25903, 26328, 817, 1798, 573, 118, 3265, 898, 3302, 26329, 26330, 26331} },
{
0x00005, 0x00019, 0x00016, 0x00011, 0x0003E, 0x0005E, 0x000EF, 0x000E2,
0x00000, 0x00039, 0x0002B, 0x00026, 0x00028, 0x00012, 0x000C2, 0x000ED,
0x0011D, 0x0000D, 0x00031, 0x0002A, 0x00025, 0x00020, 0x0005C, 0x001ED,
0x0024D, 0x00770, 0x00006, 0x0007A, 0x00060, 0x0004F, 0x00048, 0x00039,
0x00186, 0x00213, 0x00EC6, 0x0000F, 0x00026, 0x0005F, 0x00075, 0x00070,
0x00027, 0x001DB, 0x003C6, 0x0078F, 0x0003F, 0x000A6, 0x000F0, 0x0003A,
0x00052, 0x0004E, 0x000E3, 0x001D9, 0x0030F, 0x00010, 0x001DD, 0x000A7,
0x000F7, 0x00022, 0x00092, 0x003C4, 0x002EF, 0x00762, 0x00079, 0x0008F,
0x001DA, 0x00087, 0x000E8, 0x000BA, 0x00176, 0x000EE, 0x003B0, 0x00085,
0x00119, 0x0030E, 0x00108, 0x001D2, 0x0010C, 0x00773, 0x00424, 0x00434,
0x00071, 0x005DD, 0x001C1, 0x003A7, 0x00127, 0x0008D, 0x0021B, 0x007B2,
0x001DF, 0x003D8, 0x00764, 0x00EE4, 0x003B3, 0x0074D, 0x001D8, 0x005DC,
0x0084A, 0x00499, 0x003C5, 0x01D8E, 0x00765, 0x00435, 0x00771, 0x001C2,
0x00118, 0x003BC, 0x00381, 0x00387, 0x07B33, 0x01097, 0x01096, 0x01ECD,
0x00E99, 0x00F1C, 0x00F1D, 0x00EE5, 0x0011C, 0x07B32, 0x03D98, 0x01D8F,
0x00E98, 0x00F67, 0x003BD, 0x00380, 0x00498, 0x00386
},
{
0x0000D, 0x00010, 0x0002E, 0x00039, 0x0000D, 0x00074, 0x000ED, 0x000B6,
0x00001, 0x00002, 0x00000, 0x00030, 0x00029, 0x00070, 0x000F3, 0x0008C,
0x00166, 0x00009, 0x00033, 0x00078, 0x00006, 0x000C4, 0x0000B, 0x00163,
0x000CC, 0x005BE, 0x0001F, 0x0002F, 0x00064, 0x00018, 0x000C6, 0x0000A,
0x00162, 0x002C0, 0x00EF3, 0x00007, 0x0000F, 0x000E3, 0x000CA, 0x000B2,
0x0018F, 0x003AE, 0x0075F, 0x00C51, 0x00015, 0x00047, 0x000EE, 0x000E2,
0x000EA, 0x00009, 0x0016A, 0x002C3, 0x0059D, 0x0003D, 0x00008, 0x001D9,
0x00032, 0x0000E, 0x0016E, 0x0032C, 0x0065B, 0x0196B, 0x00002, 0x0000F,
0x001D8, 0x0008D, 0x000B4, 0x001E4, 0x00067, 0x00317, 0x00794, 0x00022,
0x003BE, 0x00315, 0x00034, 0x00037, 0x002DE, 0x0006C, 0x00EFE, 0x0066C,
0x00028, 0x003CB, 0x003AC, 0x00035, 0x0016B, 0x003BD, 0x002C1, 0x0062C,
0x01DFE, 0x0000E, 0x0059E, 0x005BF, 0x000DA, 0x00629, 0x00584, 0x00EB7,
0x00B0A, 0x0066D, 0x0000C, 0x0077E, 0x0059C, 0x00778, 0x0075E, 0x0075A,
0x0062D, 0x00337, 0x00334, 0x00197, 0x01E57, 0x01DE4, 0x0196A, 0x01E56,
0x00C50, 0x00B3F, 0x01E54, 0x00B0B, 0x0018E, 0x001B6, 0x01E55, 0x00CB4,
0x00B3E, 0x00EB6, 0x01DE5, 0x01DFF, 0x00335, 0x001B7
},
{
0x00001, 0x0000B, 0x00019, 0x0006F, 0x0002A, 0x00075, 0x007EB, 0x00163,
0x00001, 0x0000E, 0x0001A, 0x0003E, 0x0001C, 0x0002D, 0x00164, 0x007EC,
0x00165, 0x00004, 0x00006, 0x00036, 0x0007F, 0x000AE, 0x00158, 0x0015C,
0x0056D, 0xFD510, 0x00000, 0x00004, 0x0007B, 0x000F3, 0x0003B, 0x007ED,
0x002B3, 0x002CC, 0x0056E, 0x00018, 0x0003E, 0x00017, 0x0001E, 0x000AF,
0x003F7, 0x0056F, 0x002CD, 0xFD511, 0x00014, 0x000AD, 0x000AA, 0x00014,
0x000A8, 0x00153, 0x000E8, 0x001FE, 0x00DCF, 0x00078, 0x001B8, 0x00152,
0x000FE, 0x002B1, 0x0015D, 0x00160, 0xFD512, 0xFD513, 0x0007A, 0x002B0,
0x001E5, 0x000E9, 0x000FC, 0x006E6, 0x00DC8, 0x00584, 0xFD514, 0x000AB,
0x00DDE, 0x00159, 0x003F4, 0x00DC9, 0x00DCA, 0x001FA, 0xFD515, 0xFD516,
0x000FC, 0x001FF, 0x001E4, 0x000AF, 0x0015A, 0x00167, 0x00DCB, 0x00585,
0xFD517, 0x003F7, 0x03F55, 0xFD518, 0x00DDC, 0x00586, 0x03F56, 0xFD519,
0x03F57, 0xFD51A, 0x001BA, 0x00587, 0x00588, 0x00DDF, 0x002B2, 0xFD51B,
0x00DCE, 0x003F6, 0xFD51C, 0x00FD4, 0xFD51D, 0xFD51E, 0xFD51F, 0x7EA80,
0x7EA81, 0x0056C, 0x7EA82, 0x7EA83, 0x00376, 0x00589, 0x0058A, 0x7EA84,
0x7EA85, 0x00DDD, 0x7EA86, 0x7EA87, 0x0058B, 0x07EA9
},
{
0x00003, 0x0000E, 0x0000F, 0x0007E, 0x00062, 0x000C6, 0x00CD9, 0x0063E,
0x00002, 0x00002, 0x00000, 0x00018, 0x0000C, 0x00069, 0x00039, 0x00707,
0x00C7E, 0x00002, 0x0000D, 0x0001B, 0x0000F, 0x0019A, 0x00647, 0x01A37,
0x346C4, 0x0346D, 0x00001, 0x0001E, 0x0007F, 0x0000A, 0x000E1, 0x00661,
0x00CE4, 0x346C5, 0x346C6, 0x0001D, 0x00030, 0x0000D, 0x000CB, 0x00199,
0x00320, 0x0008E, 0x0652E, 0x346C7, 0x0003E, 0x00039, 0x00035, 0x00033,
0x0019F, 0x001C0, 0x00CDA, 0x346C8, 0x346C9, 0x0000B, 0x000D0, 0x0019E,
0x00022, 0x00038, 0x0018E, 0x0031E, 0x03294, 0x0023C, 0x00032, 0x00012,
0x00013, 0x00071, 0x0019D, 0x00020, 0x00C87, 0x00CC0, 0x346CA, 0x00338,
0x00653, 0x001A2, 0x0032A, 0x00322, 0x00CE7, 0x00084, 0x0011F, 0x346CB,
0x00325, 0x00649, 0x0032B, 0x00077, 0x00648, 0x00642, 0x00C86, 0x00C8C,
0x346CC, 0x0003A, 0x019B7, 0x00043, 0x00327, 0x0008C, 0x0008D, 0x00C8D,
0x346CD, 0x346CE, 0x00337, 0x00CE5, 0x00085, 0x00326, 0x00347, 0x00CA4,
0x00C7F, 0x00D1A, 0x346CF, 0x00328, 0x1A360, 0x1A361, 0x00CD8, 0x0068C,
0x03295, 0x03296, 0x0652F, 0x066D8, 0x00331, 0x00706, 0x0023D, 0x00076,
0x00CC1, 0x00382, 0x00CE6, 0x066D9, 0x066DA, 0x066DB
}
}; };
const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = { const uint8_t ff_vc1_2ref_mvdata_bits[8][126] = {
{4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, {
8, 9, 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 4, 5, 5, 5, 6, 7, 8, 10, 2, 5, 5, 6, 6, 7, 8, 9,
6, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 4, 5, 6, 6, 7, 8, 9, 10, 11, 4, 6, 6, 7, 7, 9,
10, 12, 5, 7, 8, 7, 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 12, 5, 8, 8, 8, 8, 9, 9, 10, 12, 5, 7, 8, 7,
9, 10, 10, 10, 10, 12, 6, 9, 9, 9, 9, 9, 10, 10, 7, 8, 9, 9, 11, 7, 9, 10, 9, 10, 10, 10, 10, 12, 6, 9,
11, 7, 10, 10, 11, 11, 11, 12, 12, 14, 8, 11, 10, 11, 9, 9, 9, 9, 10, 10, 11, 7, 10, 10, 11, 11, 11, 12, 12, 14,
11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12, 12, 13, 8, 11, 10, 11, 11, 11, 11, 12, 12, 8, 12, 11, 11, 12, 12, 12,
8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13, 12, 13, 8, 12, 11, 11, 12, 12, 12, 13, 12, 9, 14, 13, 11, 13,
12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13}, 12, 13, 12, 13, 9, 13, 13, 12, 12, 13, 13, 13, 13, 13
{3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, },
10, 11, 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, {
7, 7, 9, 10, 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 3, 4, 5, 6, 8, 10, 11, 11, 2, 5, 5, 6, 7, 8, 10, 11,
13, 13, 6, 8, 8, 8, 8, 9, 10, 12, 13, 7, 9, 8, 11, 4, 5, 5, 6, 7, 9, 12, 13, 13, 4, 6, 7, 7, 9, 10,
8, 8, 9, 11, 12, 13, 7, 9, 9, 9, 9, 9, 10, 11, 11, 13, 14, 5, 7, 7, 7, 8, 9, 11, 13, 13, 6, 8, 8, 8,
13, 8, 10, 10, 10, 10, 10, 11, 12, 13, 9, 11, 11, 10, 8, 9, 10, 12, 13, 7, 9, 8, 8, 8, 9, 11, 12, 13, 7, 9,
10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11, 12, 12, 9, 9, 9, 9, 10, 11, 13, 8, 10, 10, 10, 10, 10, 11, 12, 13,
10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13, 9, 11, 11, 10, 10, 10, 11, 11, 12, 10, 12, 12, 12, 11, 11, 11,
11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11}, 12, 12, 10, 13, 12, 12, 11, 11, 11, 12, 12, 10, 13, 13, 12, 13,
{4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 11, 12, 11, 12, 10, 14, 13, 13, 12, 12, 12, 11, 11, 11
7, 9, 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, },
7, 7, 9, 9, 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, {
10, 12, 5, 8, 8, 8, 8, 8, 9, 10, 10, 6, 9, 8, 4, 4, 5, 5, 6, 7, 8, 9, 2, 5, 6, 6, 6, 7, 7, 9,
8, 8, 8, 9, 9, 11, 6, 10, 10, 9, 9, 9, 9, 10, 9, 4, 6, 6, 6, 7, 8, 9, 11, 12, 5, 7, 7, 7, 9, 9,
10, 7, 11, 10, 9, 9, 10, 9, 10, 11, 7, 10, 11, 10, 10, 11, 12, 5, 7, 7, 7, 7, 9, 9, 10, 12, 5, 8, 8, 8,
10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11, 10, 10, 8, 8, 9, 10, 10, 6, 9, 8, 8, 8, 8, 9, 9, 11, 6, 10,
8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11, 10, 9, 9, 9, 9, 10, 10, 7, 11, 10, 9, 9, 10, 9, 10, 11,
11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10}, 7, 10, 11, 10, 10, 10, 9, 10, 11, 8, 12, 11, 11, 10, 11, 11,
{3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 10, 8, 12, 12, 11, 11, 11, 11, 10, 11, 8, 13, 12, 12, 11,
10, 11, 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 11, 11, 11, 10, 9, 13, 12, 12, 12, 11, 11, 10, 10, 10
6, 7, 9, 11, 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, },
15, 13, 6, 8, 8, 8, 9, 10, 12, 14, 13, 7, 10, 9, {
9, 9, 9, 12, 13, 14, 7, 11, 10, 10, 10, 10, 11, 12, 3, 4, 6, 7, 7, 9, 11, 11, 2, 5, 5, 6, 8, 9, 10, 11,
13, 8, 11, 12, 12, 12, 11, 12, 14, 15, 9, 11, 12, 11, 13, 3, 5, 5, 7, 8, 9, 12, 14, 13, 4, 6, 6, 7, 9, 11,
12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13, 14, 14, 13, 14, 14, 5, 7, 7, 8, 9, 9, 13, 15, 13, 6, 8, 8, 8,
9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13, 9, 10, 12, 14, 13, 7, 10, 9, 9, 9, 9, 12, 13, 14, 7, 11,
11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14}, 10, 10, 10, 10, 11, 12, 13, 8, 11, 12, 12, 12, 11, 12, 14, 15,
{4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 9, 11, 12, 11, 12, 11, 11, 12, 13, 9, 12, 13, 13, 12, 12, 13,
8, 9, 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 14, 14, 9, 12, 13, 13, 13, 12, 13, 12, 14, 10, 13, 13, 14, 13,
7, 7, 7, 7, 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 11, 13, 14, 15, 10, 12, 13, 15, 14, 13, 13, 13, 14, 14
10, 11, 6, 8, 8, 7, 7, 7, 8, 9, 10, 6, 9, 8, },
8, 7, 8, 10, 10, 11, 7, 9, 9, 8, 8, 8, 9, 9, {
10, 8, 10, 10, 9, 9, 9, 11, 11, 11, 8, 11, 10, 10, 4, 5, 5, 5, 6, 7, 8, 8, 2, 6, 6, 6, 6, 6, 8, 9,
9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11, 12, 11, 10, 4, 6, 6, 6, 6, 7, 9, 10, 11, 4, 7, 7, 7, 7, 7,
10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13, 9, 10, 12, 5, 7, 7, 7, 7, 7, 9, 10, 11, 6, 8, 8, 7,
12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11}, 7, 7, 8, 9, 10, 6, 9, 8, 8, 7, 8, 10, 10, 11, 7, 9,
{4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 9, 8, 8, 8, 9, 9, 10, 8, 10, 10, 9, 9, 9, 11, 11, 11,
8, 8, 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 8, 11, 10, 10, 9, 9, 10, 11, 10, 10, 12, 12, 11, 11, 10, 11,
7, 7, 8, 8, 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 12, 11, 10, 13, 12, 11, 11, 10, 10, 11, 11, 11, 15, 13, 13, 13,
11, 12, 5, 7, 8, 8, 8, 8, 9, 10, 11, 6, 8, 9, 12, 12, 12, 12, 10, 15, 14, 13, 12, 12, 11, 11, 11, 11
8, 8, 9, 10, 11, 13, 5, 8, 9, 8, 8, 9, 9, 10, },
11, 6, 10, 10, 9, 9, 10, 10, 12, 13, 6, 10, 10, 9, {
9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12, 12, 13, 4, 5, 6, 6, 6, 7, 8, 8, 2, 4, 5, 6, 6, 7, 8, 8,
7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13, 9, 4, 6, 7, 7, 8, 8, 9, 10, 11, 5, 6, 7, 7, 8, 8,
12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12}, 9, 10, 12, 5, 7, 8, 8, 8, 9, 10, 11, 12, 5, 7, 8, 8,
{3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 8, 8, 9, 10, 11, 6, 8, 9, 8, 8, 9, 10, 11, 13, 5, 8,
12, 12, 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 9, 8, 8, 9, 9, 10, 11, 6, 10, 10, 9, 9, 10, 10, 12, 13,
8, 9, 9, 12, 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 6, 10, 10, 9, 9, 10, 10, 11, 13, 7, 11, 11, 11, 11, 11, 12,
13, 21, 6, 9, 9, 8, 9, 10, 11, 12, 13, 8, 10, 10, 12, 13, 7, 11, 11, 11, 11, 11, 11, 12, 12, 9, 13, 13, 13, 13,
11, 11, 12, 12, 21, 21, 8, 11, 10, 11, 11, 12, 13, 14, 12, 12, 13, 12, 9, 12, 13, 12, 12, 12, 13, 13, 12, 12
21, 9, 13, 10, 11, 13, 13, 12, 21, 21, 9, 12, 10, 11, },
12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21, 15, 21, {
10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20, 3, 5, 6, 8, 9, 10, 12, 12, 1, 5, 6, 7, 8, 9, 12, 12,
20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16}, 12, 4, 6, 7, 8, 9, 12, 12, 14, 21, 4, 6, 8, 9, 9, 12,
{2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 13, 13, 14, 6, 9, 8, 8, 9, 13, 14, 13, 21, 6, 9, 9, 8,
10, 13, 14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 9, 10, 11, 12, 13, 8, 10, 10, 11, 11, 12, 12, 21, 21, 8, 11,
8, 8, 10, 12, 13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 10, 11, 11, 12, 13, 14, 21, 9, 13, 10, 11, 13, 13, 12, 21, 21,
16, 20, 7, 8, 8, 8, 10, 11, 13, 20, 20, 8, 10, 10, 9, 12, 10, 11, 12, 12, 13, 14, 21, 11, 15, 21, 13, 14, 15, 21,
10, 10, 11, 12, 15, 14, 8, 9, 9, 9, 10, 10, 13, 13, 15, 21, 10, 14, 14, 13, 13, 21, 13, 13, 21, 13, 21, 21, 21, 20,
20, 11, 12, 11, 11, 11, 13, 12, 13, 20, 11, 12, 11, 11, 20, 14, 20, 20, 11, 14, 14, 20, 20, 13, 20, 20, 14, 16
12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13, 20, 20, },
11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13, {
15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16} 2, 5, 6, 8, 9, 10, 13, 13, 2, 4, 5, 6, 8, 9, 10, 13,
14, 3, 5, 7, 8, 10, 12, 15, 20, 16, 4, 6, 8, 8, 10, 12,
13, 20, 20, 7, 8, 8, 9, 10, 11, 12, 16, 20, 7, 8, 8, 8,
10, 11, 13, 20, 20, 8, 10, 10, 10, 10, 11, 12, 15, 14, 8, 9,
9, 9, 10, 10, 13, 13, 20, 11, 12, 11, 11, 11, 13, 12, 13, 20,
11, 12, 11, 11, 12, 12, 13, 13, 20, 10, 14, 11, 11, 12, 12, 13,
20, 20, 11, 13, 12, 11, 12, 13, 14, 14, 20, 11, 19, 19, 13, 13,
15, 15, 16, 16, 11, 13, 14, 11, 13, 12, 13, 16, 16, 16
}
}; };
const uint8_t wmv3_dc_scale_table[32] = { const uint8_t wmv3_dc_scale_table[32] = {
0, 2, 4, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21 0, 2, 4, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13,
14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21
}; };
/* P-Picture CBPCY VLC tables */ /* P-Picture CBPCY VLC tables */
@ -584,108 +707,137 @@ const uint8_t ff_vc1_cbpcy_p_bits[4][64] = {
}; };
/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ /* Interlaced CBPCY VLC tables (Table 124 - Table 131) */
const uint16_t ff_vc1_icbpcy_p_codes[8][63] = { const uint16_t ff_vc1_icbpcy_p_codes[8][63] = {
{ {
12058, 12059, 6028, 144, 680, 681, 3015, 145, 682, 683, 1504, 74, 150, 0x2F1A, 0x2F1B, 0x178C, 0x0090, 0x02A8, 0x02A9, 0x0BC7, 0x0091,
151, 189, 146, 684, 685, 1505, 152, 306, 307, 377, 308, 618, 619, 764, 0x02AA, 0x02AB, 0x05E0, 0x004A, 0x0096, 0x0097, 0x00BD, 0x0092,
78, 64, 65, 43, 147, 686, 687, 1506, 310, 622, 623, 765, 158, 318, 0x02AC, 0x02AD, 0x05E1, 0x0098, 0x0132, 0x0133, 0x0179, 0x0134,
319, 383, 80, 66, 67, 44, 81, 164, 165, 190, 83, 68, 69, 45, 0x026A, 0x026B, 0x02FC, 0x004E, 0x0040, 0x0041, 0x002B, 0x0093,
84, 70, 71, 46, 3, 0, 1, 1 0x02AE, 0x02AF, 0x05E2, 0x0136, 0x026E, 0x026F, 0x02FD, 0x009E,
}, { 0x013E, 0x013F, 0x017F, 0x0050, 0x0042, 0x0043, 0x002C, 0x0051,
65, 66, 256, 67, 136, 137, 257, 69, 140, 141, 258, 16, 34, 0x00A4, 0x00A5, 0x00BE, 0x0053, 0x0044, 0x0045, 0x002D, 0x0054,
35, 36, 71, 16, 17, 259, 37, 88, 89, 90, 91, 90, 91, 92, 0x0046, 0x0047, 0x002E, 0x0003, 0x0000, 0x0001, 0x0001
12, 48, 49, 25, 9, 20, 21, 44, 92, 93, 94, 95, 38, 93, },
94, 95, 13, 52, 53, 27, 20, 39, 42, 43, 14, 56, 57, 29, {
15, 60, 61, 31, 5, 9, 0, 3 0x0041, 0x0042, 0x0100, 0x0043, 0x0088, 0x0089, 0x0101, 0x0045,
}, { 0x008C, 0x008D, 0x0102, 0x0010, 0x0022, 0x0023, 0x0024, 0x0047,
50, 51, 26, 38, 228, 229, 486, 39, 230, 231, 487, 14, 99, 0x0010, 0x0011, 0x0103, 0x0025, 0x0058, 0x0059, 0x005A, 0x005B,
108, 119, 40, 232, 233, 488, 123, 218, 219, 236, 245, 440, 441, 474, 0x005A, 0x005B, 0x005C, 0x000C, 0x0030, 0x0031, 0x0019, 0x0009,
33, 75, 84, 43, 41, 234, 235, 489, 74, 442, 443, 475, 32, 222, 0x0014, 0x0015, 0x002C, 0x005C, 0x005D, 0x005E, 0x005F, 0x0026,
223, 242, 34, 85, 88, 45, 15, 112, 113, 120, 35, 89, 92, 47, 0x005D, 0x005E, 0x005F, 0x000D, 0x0034, 0x0035, 0x001B, 0x0014,
36, 93, 98, 48, 2, 31, 6, 0 0x0027, 0x002A, 0x002B, 0x000E, 0x0038, 0x0039, 0x001D, 0x000F,
}, { 0x003C, 0x003D, 0x001F, 0x0005, 0x0009, 0x0000, 0x0003
40, 41, 157, 0, 490, 491, 492, 1, 493, 494, 495, 5, 240, },
241, 59, 2, 496, 497, 498, 63, 348, 349, 153, 16, 976, 977, 304, {
15, 158, 159, 251, 3, 499, 500, 501, 17, 978, 979, 305, 9, 350, 0x0032, 0x0033, 0x001A, 0x0026, 0x00E4, 0x00E5, 0x01E6, 0x0027,
351, 156, 16, 168, 169, 56, 6, 242, 243, 77, 17, 170, 171, 57, 0x00E6, 0x00E7, 0x01E7, 0x000E, 0x0063, 0x006C, 0x0077, 0x0028,
18, 172, 173, 58, 6, 22, 23, 14 0x00E8, 0x00E9, 0x01E8, 0x007B, 0x00DA, 0x00DB, 0x00EC, 0x00F5,
}, { 0x01B8, 0x01B9, 0x01DA, 0x0021, 0x004B, 0x0054, 0x002B, 0x0029,
60, 61, 31, 10, 97, 98, 2, 11, 99, 100, 3, 7, 3, 0x00EA, 0x00EB, 0x01E9, 0x004A, 0x01BA, 0x01BB, 0x01DB, 0x0020,
4, 11, 12, 101, 102, 4, 18, 10, 11, 20, 27, 24, 25, 52, 0x00DE, 0x00DF, 0x00F2, 0x0022, 0x0055, 0x0058, 0x002D, 0x000F,
44, 103, 104, 53, 13, 105, 108, 5, 96, 26, 27, 53, 19, 14, 0x0070, 0x0071, 0x0078, 0x0023, 0x0059, 0x005C, 0x002F, 0x0024,
15, 21, 45, 109, 110, 56, 8, 8, 9, 12, 46, 111, 114, 58, 0x005D, 0x0062, 0x0030, 0x0002, 0x001F, 0x0006, 0x0000
47, 115, 0, 59, 7, 20, 21, 4 },
}, { {
56, 57, 157, 10, 145, 146, 147, 11, 148, 149, 150, 3, 238, 0x0028, 0x0029, 0x009D, 0x0000, 0x01EA, 0x01EB, 0x01EC, 0x0001,
239, 54, 12, 151, 152, 153, 8, 484, 485, 106, 24, 972, 973, 214, 0x01ED, 0x01EE, 0x01EF, 0x0005, 0x00F0, 0x00F1, 0x003B, 0x0002,
14, 158, 159, 245, 13, 154, 155, 156, 25, 974, 975, 215, 9, 488, 0x01F0, 0x01F1, 0x01F2, 0x003F, 0x015C, 0x015D, 0x0099, 0x0010,
489, 144, 15, 232, 233, 246, 5, 240, 241, 55, 16, 234, 235, 247, 0x03D0, 0x03D1, 0x0130, 0x000F, 0x009E, 0x009F, 0x00FB, 0x0003,
17, 236, 237, 52, 0, 62, 63, 2 0x01F3, 0x01F4, 0x01F5, 0x0011, 0x03D2, 0x03D3, 0x0131, 0x0009,
}, { 0x015E, 0x015F, 0x009C, 0x0010, 0x00A8, 0x00A9, 0x0038, 0x0006,
60, 61, 463, 0, 191, 224, 508, 1, 225, 226, 509, 9, 497, 0x00F2, 0x00F3, 0x004D, 0x0011, 0x00AA, 0x00AB, 0x0039, 0x0012,
498, 499, 2, 227, 228, 510, 17, 1006, 1007, 1008, 33, 2018, 2019, 2020, 0x00AC, 0x00AD, 0x003A, 0x0006, 0x0016, 0x0017, 0x000E
24, 1015, 1022, 1023, 3, 229, 230, 128, 46, 2021, 2022, 2023, 22, 1012, },
1013, 1014, 25, 258, 259, 260, 10, 500, 501, 502, 26, 261, 262, 263, {
27, 376, 377, 462, 29, 189, 190, 496 0x003C, 0x003D, 0x001F, 0x000A, 0x0061, 0x0062, 0x0002, 0x000B,
}, { 0x0063, 0x0064, 0x0003, 0x0007, 0x0003, 0x0004, 0x000B, 0x000C,
3, 4, 438, 4, 46, 47, 14, 5, 48, 49, 15, 3, 10, 0x0065, 0x0066, 0x0004, 0x0012, 0x000A, 0x000B, 0x0014, 0x001B,
11, 20, 6, 50, 51, 16, 5, 48, 49, 50, 9, 102, 103, 104, 0x0018, 0x0019, 0x0034, 0x002C, 0x0067, 0x0068, 0x0035, 0x000D,
29, 439, 440, 441, 7, 52, 53, 17, 22, 105, 106, 107, 10, 54, 0x0069, 0x006C, 0x0005, 0x0060, 0x001A, 0x001B, 0x0035, 0x0013,
55, 216, 30, 442, 443, 444, 4, 21, 22, 23, 31, 445, 446, 447, 0x000E, 0x000F, 0x0015, 0x002D, 0x006D, 0x006E, 0x0038, 0x0008,
0, 16, 17, 18, 28, 217, 218, 19 0x0008, 0x0009, 0x000C, 0x002E, 0x006F, 0x0072, 0x003A, 0x002F,
0x0073, 0x0000, 0x003B, 0x0007, 0x0014, 0x0015, 0x0004
},
{
0x0038, 0x0039, 0x009D, 0x000A, 0x0091, 0x0092, 0x0093, 0x000B,
0x0094, 0x0095, 0x0096, 0x0003, 0x00EE, 0x00EF, 0x0036, 0x000C,
0x0097, 0x0098, 0x0099, 0x0008, 0x01E4, 0x01E5, 0x006A, 0x0018,
0x03CC, 0x03CD, 0x00D6, 0x000E, 0x009E, 0x009F, 0x00F5, 0x000D,
0x009A, 0x009B, 0x009C, 0x0019, 0x03CE, 0x03CF, 0x00D7, 0x0009,
0x01E8, 0x01E9, 0x0090, 0x000F, 0x00E8, 0x00E9, 0x00F6, 0x0005,
0x00F0, 0x00F1, 0x0037, 0x0010, 0x00EA, 0x00EB, 0x00F7, 0x0011,
0x00EC, 0x00ED, 0x0034, 0x0000, 0x003E, 0x003F, 0x0002
},
{
0x003C, 0x003D, 0x01CF, 0x0000, 0x00BF, 0x00E0, 0x01FC, 0x0001,
0x00E1, 0x00E2, 0x01FD, 0x0009, 0x01F1, 0x01F2, 0x01F3, 0x0002,
0x00E3, 0x00E4, 0x01FE, 0x0011, 0x03EE, 0x03EF, 0x03F0, 0x0021,
0x07E2, 0x07E3, 0x07E4, 0x0018, 0x03F7, 0x03FE, 0x03FF, 0x0003,
0x00E5, 0x00E6, 0x0080, 0x002E, 0x07E5, 0x07E6, 0x07E7, 0x0016,
0x03F4, 0x03F5, 0x03F6, 0x0019, 0x0102, 0x0103, 0x0104, 0x000A,
0x01F4, 0x01F5, 0x01F6, 0x001A, 0x0105, 0x0106, 0x0107, 0x001B,
0x0178, 0x0179, 0x01CE, 0x001D, 0x00BD, 0x00BE, 0x01F0
},
{
0x0003, 0x0004, 0x01B6, 0x0004, 0x002E, 0x002F, 0x000E, 0x0005,
0x0030, 0x0031, 0x000F, 0x0003, 0x000A, 0x000B, 0x0014, 0x0006,
0x0032, 0x0033, 0x0010, 0x0005, 0x0030, 0x0031, 0x0032, 0x0009,
0x0066, 0x0067, 0x0068, 0x001D, 0x01B7, 0x01B8, 0x01B9, 0x0007,
0x0034, 0x0035, 0x0011, 0x0016, 0x0069, 0x006A, 0x006B, 0x000A,
0x0036, 0x0037, 0x00D8, 0x001E, 0x01BA, 0x01BB, 0x01BC, 0x0004,
0x0015, 0x0016, 0x0017, 0x001F, 0x01BD, 0x01BE, 0x01BF, 0x0000,
0x0010, 0x0011, 0x0012, 0x001C, 0x00D9, 0x00DA, 0x0013
} }
}; };
const uint8_t ff_vc1_icbpcy_p_bits[8][63] = { const uint8_t ff_vc1_icbpcy_p_bits[8][63] = {
{ {
15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 15, 15, 14, 9, 11, 11, 13, 9, 11, 11, 12, 8, 9, 9, 9, 9,
9, 9, 9, 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 9, 10, 10, 10, 10, 11, 11, 11, 8, 8, 8, 7, 9,
8, 8, 8, 7, 9, 11, 11, 12, 10, 11, 11, 11, 9, 10, 11, 11, 12, 10, 11, 11, 11, 9, 10, 10, 10, 8, 8, 8, 7, 8,
10, 10, 8, 8, 8, 7, 8, 9, 9, 9, 8, 8, 8, 7, 9, 9, 9, 8, 8, 8, 7, 8, 8, 8, 7, 3, 3, 3, 1
8, 8, 8, 7, 3, 3, 3, 1 },
}, { {
7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 9, 7, 8, 8, 9, 7, 8, 8, 9, 6, 7, 7, 7, 7,
7, 7, 7, 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 7, 7, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6,
6, 7, 7, 6, 6, 7, 7, 8, 8, 9, 9, 9, 7, 8, 7, 7, 8, 8, 9, 9, 9, 7, 8, 8, 8, 6, 7, 7, 6, 6,
8, 8, 6, 7, 7, 6, 6, 7, 7, 7, 6, 7, 7, 6, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 4, 3, 2
6, 7, 7, 6, 3, 4, 3, 2 },
}, { {
6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 6, 6, 5, 6, 8, 8, 9, 6, 8, 8, 9, 5, 7, 7, 7, 6,
7, 7, 6, 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 8, 8, 9, 7, 8, 8, 8, 8, 9, 9, 9, 6, 7, 7, 6, 6,
6, 7, 7, 6, 6, 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 9, 7, 9, 9, 9, 6, 8, 8, 8, 6, 7, 7, 6, 5,
8, 8, 6, 7, 7, 6, 5, 7, 7, 7, 6, 7, 7, 6, 7, 7, 7, 6, 7, 7, 6, 6, 7, 7, 6, 3, 5, 4, 2
6, 7, 7, 6, 3, 5, 4, 2 },
}, { {
6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 6, 6, 8, 4, 9, 9, 9, 4, 9, 9, 9, 4, 8, 8, 7, 4,
8, 7, 4, 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 9, 9, 9, 6, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4,
5, 8, 8, 8, 4, 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 9, 9, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 7, 4,
9, 8, 5, 8, 8, 7, 4, 8, 8, 7, 5, 8, 8, 7, 8, 8, 7, 5, 8, 8, 7, 5, 8, 8, 7, 3, 5, 5, 4
5, 8, 8, 7, 3, 5, 5, 4 },
}, { {
6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5, 5, 7, 7, 7, 5, 7, 7, 7, 5, 6, 6, 6, 5,
6, 6, 5, 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 7, 7, 7, 6, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 6, 5,
6, 7, 7, 6, 5, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 7, 7, 8, 8, 8, 6, 7, 7, 7, 6, 7, 7, 6, 5,
7, 7, 6, 7, 7, 6, 5, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 6, 7, 7, 6, 6, 7, 6, 6, 4, 5, 5, 3
6, 7, 6, 6, 4, 5, 5, 3 },
}, { {
6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 6, 6, 8, 4, 8, 8, 8, 4, 8, 8, 8, 4, 8, 8, 7, 4,
8, 7, 4, 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 8, 8, 8, 5, 9, 9, 8, 6, 10, 10, 9, 5, 8, 8, 8, 4,
5, 8, 8, 8, 4, 8, 8, 8, 6, 10, 10, 9, 5, 9, 8, 8, 8, 6, 10, 10, 9, 5, 9, 9, 8, 5, 8, 8, 8, 4,
9, 8, 5, 8, 8, 8, 4, 8, 8, 7, 5, 8, 8, 8, 8, 8, 7, 5, 8, 8, 8, 5, 8, 8, 7, 3, 6, 6, 4
5, 8, 8, 7, 3, 6, 6, 4 },
}, { {
6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 6, 6, 9, 3, 8, 8, 9, 3, 8, 8, 9, 4, 9, 9, 9, 3,
9, 9, 3, 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 8, 8, 9, 5, 10, 10, 10, 6, 11, 11, 11, 5, 10, 10, 10, 3,
5, 10, 10, 10, 3, 8, 8, 8, 6, 11, 11, 11, 5, 10, 8, 8, 8, 6, 11, 11, 11, 5, 10, 10, 10, 5, 9, 9, 9, 4,
10, 10, 5, 9, 9, 9, 4, 9, 9, 9, 5, 9, 9, 9, 9, 9, 9, 5, 9, 9, 9, 5, 9, 9, 9, 5, 8, 8, 9
5, 9, 9, 9, 5, 8, 8, 9 },
}, { {
6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 6, 6, 10, 3, 7, 7, 7, 3, 7, 7, 7, 4, 8, 8, 8, 3,
8, 8, 3, 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 7, 7, 7, 5, 9, 9, 9, 6, 10, 10, 10, 6, 10, 10, 10, 3,
6, 10, 10, 10, 3, 7, 7, 7, 6, 10, 10, 10, 5, 9, 7, 7, 7, 6, 10, 10, 10, 5, 9, 9, 9, 6, 10, 10, 10, 4,
9, 9, 6, 10, 10, 10, 4, 8, 8, 8, 6, 10, 10, 10, 8, 8, 8, 6, 10, 10, 10, 5, 9, 9, 9, 6, 9, 9, 9
5, 9, 9, 9, 6, 9, 9, 9
} }
}; };
@ -867,24 +1019,21 @@ const uint8_t ff_vc1_mv_diff_bits[4][73] = {
/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ /* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */
/* Table 232 */ /* Table 232 */
const int8_t ff_vc1_simple_progressive_4x4_zz [16] = const int8_t ff_vc1_simple_progressive_4x4_zz [16] = {
{
0, 8, 16, 1, 0, 8, 16, 1,
9, 24, 17, 2, 9, 24, 17, 2,
10, 18, 25, 3, 10, 18, 25, 3,
11, 26, 19, 27 11, 26, 19, 27
}; };
const int8_t ff_vc1_adv_progressive_8x4_zz [32] = /* Table 233 */ const int8_t ff_vc1_adv_progressive_8x4_zz [32] = { /* Table 233 */
{
0, 8, 1, 16, 2, 9, 10, 3, 0, 8, 1, 16, 2, 9, 10, 3,
24, 17, 4, 11, 18, 12, 5, 19, 24, 17, 4, 11, 18, 12, 5, 19,
25, 13, 20, 26, 27, 6, 21, 28, 25, 13, 20, 26, 27, 6, 21, 28,
14, 22, 29, 7, 30, 15, 23, 31 14, 22, 29, 7, 30, 15, 23, 31
}; };
const int8_t ff_vc1_adv_progressive_4x8_zz [32] = /* Table 234 */ const int8_t ff_vc1_adv_progressive_4x8_zz [32] = { /* Table 234 */
{
0, 1, 8, 2, 0, 1, 8, 2,
9, 16, 17, 24, 9, 16, 17, 24,
10, 32, 25, 18, 10, 32, 25, 18,
@ -895,8 +1044,7 @@ const int8_t ff_vc1_adv_progressive_4x8_zz [32] = /* Table 234 */
35, 43, 51, 59 35, 43, 51, 59
}; };
const int8_t ff_vc1_adv_interlaced_8x8_zz [64] = /* Table 235 */ const int8_t ff_vc1_adv_interlaced_8x8_zz [64] = { /* Table 235 */
{
0, 8, 1, 16, 24, 9, 2, 32, 0, 8, 1, 16, 24, 9, 2, 32,
40, 48, 56, 17, 10, 3, 25, 18, 40, 48, 56, 17, 10, 3, 25, 18,
11, 4, 33, 41, 49, 57, 26, 34, 11, 4, 33, 41, 49, 57, 26, 34,
@ -907,16 +1055,14 @@ const int8_t ff_vc1_adv_interlaced_8x8_zz [64] = /* Table 235 */
61, 62, 54, 46, 39, 47, 55, 63 61, 62, 54, 46, 39, 47, 55, 63
}; };
const int8_t ff_vc1_adv_interlaced_8x4_zz [32] = /* Table 236 */ const int8_t ff_vc1_adv_interlaced_8x4_zz [32] = { /* Table 236 */
{
0, 8, 16, 24, 1, 9, 2, 17, 0, 8, 16, 24, 1, 9, 2, 17,
25, 10, 3, 18, 26, 4, 11, 19, 25, 10, 3, 18, 26, 4, 11, 19,
12, 5, 13, 20, 27, 6, 21, 28, 12, 5, 13, 20, 27, 6, 21, 28,
14, 22, 29, 7, 30, 15, 23, 31 14, 22, 29, 7, 30, 15, 23, 31
}; };
const int8_t ff_vc1_adv_interlaced_4x8_zz [32] = /* Table 237 */ const int8_t ff_vc1_adv_interlaced_4x8_zz [32] = { /* Table 237 */
{
0, 1, 2, 8, 0, 1, 2, 8,
16, 9, 24, 17, 16, 9, 24, 17,
10, 3, 32, 40, 10, 3, 32, 40,
@ -927,8 +1073,7 @@ const int8_t ff_vc1_adv_interlaced_4x8_zz [32] = /* Table 237 */
35, 43, 51, 59 35, 43, 51, 59
}; };
const int8_t ff_vc1_adv_interlaced_4x4_zz [16] = /* Table 238 */ const int8_t ff_vc1_adv_interlaced_4x4_zz [16] = { /* Table 238 */
{
0, 8, 16, 24, 0, 8, 16, 24,
1, 9, 17, 2, 1, 9, 17, 2,
25, 10, 18, 3, 25, 10, 18, 3,
@ -950,7 +1095,8 @@ const int32_t ff_vc1_dqscale[63] = {
/* P Interlaced field picture MV predictor scaling values (Table 114) */ /* P Interlaced field picture MV predictor scaling values (Table 114) */
const uint16_t vc1_field_mvpred_scales[2][7][4] = { const uint16_t vc1_field_mvpred_scales[2][7][4] = {
// Refdist 0 1 2 3 or greater // Refdist:
// 0 1 2 3 or greater
{ // current field is first { // current field is first
{ 128, 192, 213, 224 }, // SCALEOPP { 128, 192, 213, 224 }, // SCALEOPP
{ 512, 341, 307, 293 }, // SCALESAME1 { 512, 341, 307, 293 }, // SCALESAME1
@ -973,7 +1119,8 @@ const uint16_t vc1_field_mvpred_scales[2][7][4] = {
/* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */ /* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */
const uint16_t vc1_b_field_mvpred_scales[7][4] = { const uint16_t vc1_b_field_mvpred_scales[7][4] = {
// BRFD 0 1 2 3 or greater // BRFD:
// 0 1 2 3 or greater
{ 171, 205, 219, 228 }, // SCALESAME { 171, 205, 219, 228 }, // SCALESAME
{ 384, 320, 299, 288 }, // SCALEOPP1 { 384, 320, 299, 288 }, // SCALEOPP1
{ 230, 239, 244, 246 }, // SCALEOPP2 { 230, 239, 244, 246 }, // SCALEOPP2

File diff suppressed because it is too large Load Diff

@ -132,8 +132,8 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
} }
static const AVOption options[] = { static const AVOption options[] = {
{ "sample_rate", "", offsetof(AlsaData, sample_rate), FF_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "sample_rate", "", offsetof(AlsaData, sample_rate), AV_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "channels", "", offsetof(AlsaData, channels), FF_OPT_TYPE_INT, {.dbl = 2}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channels", "", offsetof(AlsaData, channels), AV_OPT_TYPE_INT, {.dbl = 2}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -325,15 +325,15 @@ static int grab_read_close(AVFormatContext *s1)
#define OFFSET(x) offsetof(VideoData, x) #define OFFSET(x) offsetof(VideoData, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "standard", "", offsetof(VideoData, standard), FF_OPT_TYPE_INT, {.dbl = VIDEO_FORMAT}, PAL, NTSCJ, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "standard", "", offsetof(VideoData, standard), AV_OPT_TYPE_INT, {.dbl = VIDEO_FORMAT}, PAL, NTSCJ, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PAL", "", 0, FF_OPT_TYPE_CONST, {.dbl = PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "PAL", "", 0, AV_OPT_TYPE_CONST, {.dbl = PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "NTSC", "", 0, FF_OPT_TYPE_CONST, {.dbl = NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "NTSC", "", 0, AV_OPT_TYPE_CONST, {.dbl = NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "SECAM", "", 0, FF_OPT_TYPE_CONST, {.dbl = SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "SECAM", "", 0, AV_OPT_TYPE_CONST, {.dbl = SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PALN", "", 0, FF_OPT_TYPE_CONST, {.dbl = PALN}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "PALN", "", 0, AV_OPT_TYPE_CONST, {.dbl = PALN}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PALM", "", 0, FF_OPT_TYPE_CONST, {.dbl = PALM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "PALM", "", 0, AV_OPT_TYPE_CONST, {.dbl = PALM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "NTSCJ", "", 0, FF_OPT_TYPE_CONST, {.dbl = NTSCJ}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "NTSCJ", "", 0, AV_OPT_TYPE_CONST, {.dbl = NTSCJ}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -214,10 +214,10 @@ static int dv1394_close(AVFormatContext * context)
} }
static const AVOption options[] = { static const AVOption options[] = {
{ "standard", "", offsetof(struct dv1394_data, format), FF_OPT_TYPE_INT, {.dbl = DV1394_NTSC}, DV1394_PAL, DV1394_NTSC, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "standard", "", offsetof(struct dv1394_data, format), AV_OPT_TYPE_INT, {.dbl = DV1394_NTSC}, DV1394_PAL, DV1394_NTSC, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PAL", "", 0, FF_OPT_TYPE_CONST, {.dbl = DV1394_PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "PAL", "", 0, AV_OPT_TYPE_CONST, {.dbl = DV1394_PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "NTSC", "", 0, FF_OPT_TYPE_CONST, {.dbl = DV1394_NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "NTSC", "", 0, AV_OPT_TYPE_CONST, {.dbl = DV1394_NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "channel", "", offsetof(struct dv1394_data, channel), FF_OPT_TYPE_INT, {.dbl = DV1394_DEFAULT_CHANNEL}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channel", "", offsetof(struct dv1394_data, channel), AV_OPT_TYPE_INT, {.dbl = DV1394_DEFAULT_CHANNEL}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -247,7 +247,7 @@ av_cold static int fbdev_read_close(AVFormatContext *avctx)
#define OFFSET(x) offsetof(FBDevContext, x) #define OFFSET(x) offsetof(FBDevContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "framerate","", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, { "framerate","", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -314,7 +314,7 @@ static int audio_read_close(AVFormatContext *context)
#define OFFSET(x) offsetof(JackData, x) #define OFFSET(x) offsetof(JackData, x)
static const AVOption options[] = { static const AVOption options[] = {
{ "channels", "Number of audio channels.", OFFSET(nports), FF_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channels", "Number of audio channels.", OFFSET(nports), AV_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -160,11 +160,11 @@ static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp,
#define OFFSET(x) offsetof(CDIOContext, x) #define OFFSET(x) offsetof(CDIOContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "speed", "Drive reading speed.", OFFSET(speed), FF_OPT_TYPE_INT, { 0 }, 0, INT_MAX, DEC }, { "speed", "Drive reading speed.", OFFSET(speed), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, DEC },
{ "paranoia_mode", "Error recovery mode.", OFFSET(paranoia_mode), FF_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, DEC, "paranoia_mode" }, { "paranoia_mode", "Error recovery mode.", OFFSET(paranoia_mode), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, DEC, "paranoia_mode" },
{ "verify", "Verify data integrity in overlap area", 0, FF_OPT_TYPE_CONST, { PARANOIA_MODE_VERIFY }, 0, 0, DEC, "paranoia_mode" }, { "verify", "Verify data integrity in overlap area", 0, AV_OPT_TYPE_CONST, { PARANOIA_MODE_VERIFY }, 0, 0, DEC, "paranoia_mode" },
{ "overlap", "Perform overlapped reads.", 0, FF_OPT_TYPE_CONST, { PARANOIA_MODE_OVERLAP }, 0, 0, DEC, "paranoia_mode" }, { "overlap", "Perform overlapped reads.", 0, AV_OPT_TYPE_CONST, { PARANOIA_MODE_OVERLAP }, 0, 0, DEC, "paranoia_mode" },
{ "neverskip", "Do not skip failed reads.", 0, FF_OPT_TYPE_CONST, { PARANOIA_MODE_NEVERSKIP }, 0, 0, DEC, "paranoia_mode" }, { "neverskip", "Do not skip failed reads.", 0, AV_OPT_TYPE_CONST, { PARANOIA_MODE_NEVERSKIP }, 0, 0, DEC, "paranoia_mode" },
{ NULL }, { NULL },
}; };

@ -85,9 +85,9 @@ struct dc1394_frame_rate {
#define OFFSET(x) offsetof(dc1394_data, x) #define OFFSET(x) offsetof(dc1394_data, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "qvga"}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "qvga"}, 0, 0, DEC },
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "uyvy422"}, 0, 0, DEC }, { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = "uyvy422"}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -282,8 +282,8 @@ static int audio_read_close(AVFormatContext *s1)
#if CONFIG_OSS_INDEV #if CONFIG_OSS_INDEV
static const AVOption options[] = { static const AVOption options[] = {
{ "sample_rate", "", offsetof(AudioData, sample_rate), FF_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "sample_rate", "", offsetof(AudioData, sample_rate), AV_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "channels", "", offsetof(AudioData, channels), FF_OPT_TYPE_INT, {.dbl = 2}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channels", "", offsetof(AudioData, channels), AV_OPT_TYPE_INT, {.dbl = 2}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -93,8 +93,8 @@ static av_cold int audio_read_close(AVFormatContext *s1)
} }
static const AVOption options[] = { static const AVOption options[] = {
{ "sample_rate", "", offsetof(SndioData, sample_rate), FF_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "sample_rate", "", offsetof(SndioData, sample_rate), AV_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "channels", "", offsetof(SndioData, channels), FF_OPT_TYPE_INT, {.dbl = 2}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channels", "", offsetof(SndioData, channels), AV_OPT_TYPE_INT, {.dbl = 2}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -339,10 +339,10 @@ static int grab_read_close(AVFormatContext *s1)
} }
static const AVOption options[] = { static const AVOption options[] = {
{ "standard", "", offsetof(VideoData, standard), FF_OPT_TYPE_INT, {.dbl = VIDEO_MODE_NTSC}, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "standard", "", offsetof(VideoData, standard), AV_OPT_TYPE_INT, {.dbl = VIDEO_MODE_NTSC}, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "PAL", "", 0, FF_OPT_TYPE_CONST, {.dbl = VIDEO_MODE_PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "PAL", "", 0, AV_OPT_TYPE_CONST, {.dbl = VIDEO_MODE_PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "SECAM", "", 0, FF_OPT_TYPE_CONST, {.dbl = VIDEO_MODE_SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "SECAM", "", 0, AV_OPT_TYPE_CONST, {.dbl = VIDEO_MODE_SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ "NTSC", "", 0, FF_OPT_TYPE_CONST, {.dbl = VIDEO_MODE_NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, { "NTSC", "", 0, AV_OPT_TYPE_CONST, {.dbl = VIDEO_MODE_NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
{ NULL }, { NULL },
}; };

@ -689,11 +689,11 @@ static int v4l2_read_close(AVFormatContext *s1)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "standard", "", OFFSET(standard), FF_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_DECODING_PARAM }, { "standard", "", OFFSET(standard), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
{ "channel", "", OFFSET(channel), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channel", "", OFFSET(channel), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -458,8 +458,8 @@ static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
#define OFFSET(x) offsetof(struct vfw_ctx, x) #define OFFSET(x) offsetof(struct vfw_ctx, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -581,13 +581,13 @@ x11grab_read_close(AVFormatContext *s1)
#define OFFSET(x) offsetof(struct x11_grab, x) #define OFFSET(x) offsetof(struct x11_grab, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
{ "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), FF_OPT_TYPE_INT, { 1 }, 0, 1, DEC }, { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), AV_OPT_TYPE_INT, { 1 }, 0, 1, DEC },
{ "follow_mouse", "Move the grabbing region when the mouse pointer reaches within specified amount of pixels to the edge of region.", { "follow_mouse", "Move the grabbing region when the mouse pointer reaches within specified amount of pixels to the edge of region.",
OFFSET(follow_mouse), FF_OPT_TYPE_INT, { 0 }, -1, INT_MAX, DEC, "follow_mouse" }, OFFSET(follow_mouse), AV_OPT_TYPE_INT, { 0 }, -1, INT_MAX, DEC, "follow_mouse" },
{ "centered", "Keep the mouse pointer at the center of grabbing region when following.", 0, FF_OPT_TYPE_CONST, { -1 }, INT_MIN, INT_MAX, DEC, "follow_mouse" }, { "centered", "Keep the mouse pointer at the center of grabbing region when following.", 0, AV_OPT_TYPE_CONST, { -1 }, INT_MIN, INT_MAX, DEC, "follow_mouse" },
{ "show_region", "Show the grabbing region.", OFFSET(show_region), FF_OPT_TYPE_INT, { 0 }, 0, 1, DEC }, { "show_region", "Show the grabbing region.", OFFSET(show_region), AV_OPT_TYPE_INT, { 0 }, 0, 1, DEC },
{ NULL }, { NULL },
}; };

@ -67,12 +67,12 @@ typedef struct {
#define OFFSET(x) offsetof(MovieContext, x) #define OFFSET(x) offsetof(MovieContext, x)
static const AVOption movie_options[]= { static const AVOption movie_options[]= {
{"format_name", "set format name", OFFSET(format_name), FF_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX }, {"format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX },
{"f", "set format name", OFFSET(format_name), FF_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX }, {"f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX },
{"stream_index", "set stream index", OFFSET(stream_index), FF_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX }, {"stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX },
{"si", "set stream index", OFFSET(stream_index), FF_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX }, {"si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX },
{"seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), FF_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000 }, {"seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000 },
{"sp", "set seekpoint (seconds)", OFFSET(seek_point_d), FF_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000 }, {"sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000 },
{NULL}, {NULL},
}; };

@ -143,39 +143,39 @@ typedef struct {
#define OFFSET(x) offsetof(DrawTextContext, x) #define OFFSET(x) offsetof(DrawTextContext, x)
static const AVOption drawtext_options[]= { static const AVOption drawtext_options[]= {
{"fontfile", "set font file", OFFSET(fontfile), FF_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, {"fontfile", "set font file", OFFSET(fontfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX },
{"text", "set text", OFFSET(text), FF_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, {"text", "set text", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX },
{"textfile", "set text file", OFFSET(textfile), FF_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, {"textfile", "set text file", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX },
{"fontcolor", "set foreground color", OFFSET(fontcolor_string), FF_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX }, {"fontcolor", "set foreground color", OFFSET(fontcolor_string), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX },
{"boxcolor", "set box color", OFFSET(boxcolor_string), FF_OPT_TYPE_STRING, {.str="white"}, CHAR_MIN, CHAR_MAX }, {"boxcolor", "set box color", OFFSET(boxcolor_string), AV_OPT_TYPE_STRING, {.str="white"}, CHAR_MIN, CHAR_MAX },
{"shadowcolor", "set shadow color", OFFSET(shadowcolor_string), FF_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX }, {"shadowcolor", "set shadow color", OFFSET(shadowcolor_string), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX },
{"box", "set box", OFFSET(draw_box), FF_OPT_TYPE_INT, {.dbl=0}, 0, 1 }, {"box", "set box", OFFSET(draw_box), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
{"fontsize", "set font size", OFFSET(fontsize), FF_OPT_TYPE_INT, {.dbl=16}, 1, INT_MAX }, {"fontsize", "set font size", OFFSET(fontsize), AV_OPT_TYPE_INT, {.dbl=16}, 1, INT_MAX },
{"x", "set x expression", OFFSET(x_expr), FF_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX }, {"x", "set x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX },
{"y", "set y expression", OFFSET(y_expr), FF_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX }, {"y", "set y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX },
{"shadowx", "set x", OFFSET(shadowx), FF_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX }, {"shadowx", "set x", OFFSET(shadowx), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
{"shadowy", "set y", OFFSET(shadowy), FF_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX }, {"shadowy", "set y", OFFSET(shadowy), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
{"tabsize", "set tab size", OFFSET(tabsize), FF_OPT_TYPE_INT, {.dbl=4}, 0, INT_MAX }, {"tabsize", "set tab size", OFFSET(tabsize), AV_OPT_TYPE_INT, {.dbl=4}, 0, INT_MAX },
{"basetime", "set base time", OFFSET(basetime), FF_OPT_TYPE_INT64, {.dbl=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX }, {"basetime", "set base time", OFFSET(basetime), AV_OPT_TYPE_INT64, {.dbl=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX },
/* FT_LOAD_* flags */ /* FT_LOAD_* flags */
{"ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), FF_OPT_TYPE_FLAGS, {.dbl=FT_LOAD_DEFAULT|FT_LOAD_RENDER}, 0, INT_MAX, 0, "ft_load_flags" }, {"ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, {.dbl=FT_LOAD_DEFAULT|FT_LOAD_RENDER}, 0, INT_MAX, 0, "ft_load_flags" },
{"default", "set default", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_DEFAULT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"default", "set default", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_DEFAULT}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"no_scale", "set no_scale", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_SCALE}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"no_scale", "set no_scale", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_SCALE}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"no_hinting", "set no_hinting", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_HINTING}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"no_hinting", "set no_hinting", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_HINTING}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"render", "set render", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_RENDER}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"render", "set render", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_RENDER}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"no_bitmap", "set no_bitmap", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_BITMAP}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"no_bitmap", "set no_bitmap", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_BITMAP}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"vertical_layout", "set vertical_layout", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_VERTICAL_LAYOUT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"vertical_layout", "set vertical_layout", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_VERTICAL_LAYOUT}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"force_autohint", "set force_autohint", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_FORCE_AUTOHINT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"force_autohint", "set force_autohint", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_FORCE_AUTOHINT}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"crop_bitmap", "set crop_bitmap", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_CROP_BITMAP}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"crop_bitmap", "set crop_bitmap", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_CROP_BITMAP}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"pedantic", "set pedantic", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_PEDANTIC}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"pedantic", "set pedantic", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_PEDANTIC}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"ignore_global_advance_width", "set ignore_global_advance_width", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"ignore_global_advance_width", "set ignore_global_advance_width", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"no_recurse", "set no_recurse", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_RECURSE}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"no_recurse", "set no_recurse", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_RECURSE}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"ignore_transform", "set ignore_transform", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_TRANSFORM}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"ignore_transform", "set ignore_transform", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_TRANSFORM}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"monochrome", "set monochrome", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_MONOCHROME}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"monochrome", "set monochrome", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_MONOCHROME}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"linear_design", "set linear_design", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_LINEAR_DESIGN}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"linear_design", "set linear_design", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_LINEAR_DESIGN}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{"no_autohint", "set no_autohint", 0, FF_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_AUTOHINT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, {"no_autohint", "set no_autohint", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_AUTOHINT}, INT_MIN, INT_MAX, 0, "ft_load_flags" },
{NULL}, {NULL},
}; };

@ -350,8 +350,8 @@ static int open_input(struct variant *var)
snprintf(url, sizeof(url), "crypto:%s", seg->url); snprintf(url, sizeof(url), "crypto:%s", seg->url);
if ((ret = ffurl_alloc(&var->input, url, AVIO_FLAG_READ)) < 0) if ((ret = ffurl_alloc(&var->input, url, AVIO_FLAG_READ)) < 0)
return ret; return ret;
av_set_string3(var->input->priv_data, "key", key, 0, NULL); av_opt_set(var->input->priv_data, "key", key, 0);
av_set_string3(var->input->priv_data, "iv", iv, 0, NULL); av_opt_set(var->input->priv_data, "iv", iv, 0);
if ((ret = ffurl_connect(var->input)) < 0) { if ((ret = ffurl_connect(var->input)) < 0) {
ffurl_close(var->input); ffurl_close(var->input);
var->input = NULL; var->input = NULL;

@ -46,8 +46,8 @@ typedef struct {
#define OFFSET(x) offsetof(CryptoContext, x) #define OFFSET(x) offsetof(CryptoContext, x)
static const AVOption options[] = { static const AVOption options[] = {
{"key", "AES decryption key", OFFSET(key), FF_OPT_TYPE_BINARY }, {"key", "AES decryption key", OFFSET(key), AV_OPT_TYPE_BINARY },
{"iv", "AES decryption initialization vector", OFFSET(iv), FF_OPT_TYPE_BINARY }, {"iv", "AES decryption initialization vector", OFFSET(iv), AV_OPT_TYPE_BINARY },
{ NULL } { NULL }
}; };

@ -276,17 +276,35 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
acodec = astream ? astream->codec : NULL; acodec = astream ? astream->codec : NULL;
vcodec = vstream ? vstream->codec : NULL; vcodec = vstream ? vstream->codec : NULL;
if (amf_type == AMF_DATA_TYPE_NUMBER) {
if (!strcmp(key, "duration"))
s->duration = num_val * AV_TIME_BASE;
else if (!strcmp(key, "videodatarate") && vcodec && 0 <= (int)(num_val * 1024.0))
vcodec->bit_rate = num_val * 1024.0;
else if (!strcmp(key, "audiodatarate") && acodec && 0 <= (int)(num_val * 1024.0))
acodec->bit_rate = num_val * 1024.0;
}
if (!strcmp(key, "duration") ||
!strcmp(key, "filesize") ||
!strcmp(key, "width") ||
!strcmp(key, "height") ||
!strcmp(key, "videodatarate") ||
!strcmp(key, "framerate") ||
!strcmp(key, "videocodecid") ||
!strcmp(key, "audiodatarate") ||
!strcmp(key, "audiosamplerate") ||
!strcmp(key, "audiosamplesize") ||
!strcmp(key, "stereo") ||
!strcmp(key, "audiocodecid"))
return 0;
if(amf_type == AMF_DATA_TYPE_BOOL) { if(amf_type == AMF_DATA_TYPE_BOOL) {
av_strlcpy(str_val, num_val > 0 ? "true" : "false", sizeof(str_val)); av_strlcpy(str_val, num_val > 0 ? "true" : "false", sizeof(str_val));
av_dict_set(&s->metadata, key, str_val, 0); av_dict_set(&s->metadata, key, str_val, 0);
} else if(amf_type == AMF_DATA_TYPE_NUMBER) { } else if(amf_type == AMF_DATA_TYPE_NUMBER) {
snprintf(str_val, sizeof(str_val), "%.f", num_val); snprintf(str_val, sizeof(str_val), "%.f", num_val);
av_dict_set(&s->metadata, key, str_val, 0); av_dict_set(&s->metadata, key, str_val, 0);
if(!strcmp(key, "duration")) s->duration = num_val * AV_TIME_BASE;
else if(!strcmp(key, "videodatarate") && vcodec && 0 <= (int)(num_val * 1024.0))
vcodec->bit_rate = num_val * 1024.0;
else if(!strcmp(key, "audiodatarate") && acodec && 0 <= (int)(num_val * 1024.0))
acodec->bit_rate = num_val * 1024.0;
} else if(amf_type == AMF_DATA_TYPE_OBJECT){ } else if(amf_type == AMF_DATA_TYPE_OBJECT){
if(s->nb_streams==1 && ((!acodec && !strcmp(key, "audiocodecid")) || (!vcodec && !strcmp(key, "videocodecid")))){ if(s->nb_streams==1 && ((!acodec && !strcmp(key, "audiocodecid")) || (!vcodec && !strcmp(key, "videocodecid")))){
s->ctx_flags &= ~AVFMTCTX_NOHEADER; //If there is either audio/video missing, codecid will be an empty object s->ctx_flags &= ~AVFMTCTX_NOHEADER; //If there is either audio/video missing, codecid will be an empty object

@ -180,9 +180,9 @@ static int flv_write_header(AVFormatContext *s)
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
FLVContext *flv = s->priv_data; FLVContext *flv = s->priv_data;
AVCodecContext *audio_enc = NULL, *video_enc = NULL; AVCodecContext *audio_enc = NULL, *video_enc = NULL;
int i; int i, metadata_count = 0;
double framerate = 0.0; double framerate = 0.0;
int64_t metadata_size_pos, data_size; int64_t metadata_size_pos, data_size, metadata_count_pos;
AVDictionaryEntry *tag = NULL; AVDictionaryEntry *tag = NULL;
for(i=0; i<s->nb_streams; i++){ for(i=0; i<s->nb_streams; i++){
@ -240,7 +240,9 @@ static int flv_write_header(AVFormatContext *s)
/* mixed array (hash) with size and string/type/data tuples */ /* mixed array (hash) with size and string/type/data tuples */
avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY); avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
avio_wb32(pb, 5*!!video_enc + 5*!!audio_enc + 2); // +2 for duration and file size metadata_count_pos = avio_tell(pb);
metadata_count = 5*!!video_enc + 5*!!audio_enc + 2; // +2 for duration and file size
avio_wb32(pb, metadata_count);
put_amf_string(pb, "duration"); put_amf_string(pb, "duration");
flv->duration_offset= avio_tell(pb); flv->duration_offset= avio_tell(pb);
@ -300,6 +302,7 @@ static int flv_write_header(AVFormatContext *s)
put_amf_string(pb, tag->key); put_amf_string(pb, tag->key);
avio_w8(pb, AMF_DATA_TYPE_STRING); avio_w8(pb, AMF_DATA_TYPE_STRING);
put_amf_string(pb, tag->value); put_amf_string(pb, tag->value);
metadata_count++;
} }
put_amf_string(pb, "filesize"); put_amf_string(pb, "filesize");
@ -311,6 +314,10 @@ static int flv_write_header(AVFormatContext *s)
/* write total size of tag */ /* write total size of tag */
data_size= avio_tell(pb) - metadata_size_pos - 10; data_size= avio_tell(pb) - metadata_size_pos - 10;
avio_seek(pb, metadata_count_pos, SEEK_SET);
avio_wb32(pb, metadata_count);
avio_seek(pb, metadata_size_pos, SEEK_SET); avio_seek(pb, metadata_size_pos, SEEK_SET);
avio_wb24(pb, data_size); avio_wb24(pb, data_size);
avio_skip(pb, data_size + 10 - 3); avio_skip(pb, data_size + 10 - 3);

@ -351,7 +351,7 @@ static int gif_write_trailer(AVFormatContext *s)
#define OFFSET(x) offsetof(GIFContext, x) #define OFFSET(x) offsetof(GIFContext, x)
#define ENC AV_OPT_FLAG_ENCODING_PARAM #define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "loop", "Number of times to loop the output.", OFFSET(loop), FF_OPT_TYPE_INT, {0}, 0, 65535, ENC }, { "loop", "Number of times to loop the output.", OFFSET(loop), AV_OPT_TYPE_INT, {0}, 0, 65535, ENC },
{ NULL }, { NULL },
}; };

@ -54,7 +54,7 @@ typedef struct {
#define OFFSET(x) offsetof(HTTPContext, x) #define OFFSET(x) offsetof(HTTPContext, x)
static const AVOption options[] = { static const AVOption options[] = {
{"chunksize", "use chunked transfer-encoding for posts, -1 disables it, 0 enables it", OFFSET(chunksize), FF_OPT_TYPE_INT64, {.dbl = 0}, -1, 0 }, /* Default to 0, for chunked POSTs */ {"chunksize", "use chunked transfer-encoding for posts, -1 disables it, 0 enables it", OFFSET(chunksize), AV_OPT_TYPE_INT64, {.dbl = 0}, -1, 0 }, /* Default to 0, for chunked POSTs */
{NULL} {NULL}
}; };
static const AVClass httpcontext_class = { static const AVClass httpcontext_class = {

@ -462,10 +462,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
#define OFFSET(x) offsetof(VideoData, x) #define OFFSET(x) offsetof(VideoData, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "video_size", "", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
{ "loop", "", OFFSET(loop), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, DEC }, { "loop", "", OFFSET(loop), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, DEC },
{ NULL }, { NULL },
}; };

@ -38,7 +38,7 @@ typedef struct {
static const AVOption options[] = { static const AVOption options[] = {
{"smc-interval", "StreamMuxConfig interval.", {"smc-interval", "StreamMuxConfig interval.",
offsetof(LATMContext, mod), FF_OPT_TYPE_INT, {.dbl = 0x0014}, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(LATMContext, mod), AV_OPT_TYPE_INT, {.dbl = 0x0014}, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{NULL}, {NULL},
}; };

@ -42,8 +42,8 @@
#include <assert.h> #include <assert.h>
static const AVOption options[] = { static const AVOption options[] = {
{ "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
{ "rtphint", "Add RTP hint tracks", 0, FF_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "rtphint", "Add RTP hint tracks", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
{ NULL }, { NULL },
}; };

@ -191,9 +191,9 @@ AVOutputFormat ff_mp2_muxer = {
static const AVOption options[] = { static const AVOption options[] = {
{ "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.", { "id3v2_version", "Select ID3v2 version to write. Currently 3 and 4 are supported.",
offsetof(MP3Context, id3v2_version), FF_OPT_TYPE_INT, {.dbl = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MP3Context, id3v2_version), AV_OPT_TYPE_INT, {.dbl = 4}, 3, 4, AV_OPT_FLAG_ENCODING_PARAM},
{ "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.", { "write_id3v1", "Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
offsetof(MP3Context, write_id3v1), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MP3Context, write_id3v1), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL }, { NULL },
}; };

@ -126,7 +126,7 @@ struct MpegTSContext {
}; };
static const AVOption options[] = { static const AVOption options[] = {
{"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), FF_OPT_TYPE_INT, {"compute_pcr", "Compute exact PCR for each transport stream packet.", offsetof(MpegTSContext, mpeg2ts_compute_pcr), AV_OPT_TYPE_INT,
{.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -80,17 +80,17 @@ typedef struct MpegTSWrite {
static const AVOption options[] = { static const AVOption options[] = {
{ "mpegts_transport_stream_id", "Set transport_stream_id field.", { "mpegts_transport_stream_id", "Set transport_stream_id field.",
offsetof(MpegTSWrite, transport_stream_id), FF_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MpegTSWrite, transport_stream_id), AV_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_original_network_id", "Set original_network_id field.", { "mpegts_original_network_id", "Set original_network_id field.",
offsetof(MpegTSWrite, original_network_id), FF_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MpegTSWrite, original_network_id), AV_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_service_id", "Set service_id field.", { "mpegts_service_id", "Set service_id field.",
offsetof(MpegTSWrite, service_id), FF_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MpegTSWrite, service_id), AV_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_pmt_start_pid", "Set the first pid of the PMT.", { "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
offsetof(MpegTSWrite, pmt_start_pid), FF_OPT_TYPE_INT, {.dbl = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT, {.dbl = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_start_pid", "Set the first pid.", { "mpegts_start_pid", "Set the first pid.",
offsetof(MpegTSWrite, start_pid), FF_OPT_TYPE_INT, {.dbl = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM}, offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT, {.dbl = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM},
{"mpegts_m2ts_mode", "Enable m2ts mode.", {"mpegts_m2ts_mode", "Enable m2ts mode.",
offsetof(MpegTSWrite, m2ts_mode), FF_OPT_TYPE_INT, {.dbl = -1 }, offsetof(MpegTSWrite, m2ts_mode), AV_OPT_TYPE_INT, {.dbl = -1 },
-1,1, AV_OPT_FLAG_ENCODING_PARAM}, -1,1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL }, { NULL },
}; };

@ -1871,7 +1871,7 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int
mxf_interleave_get_packet, mxf_compare_timestamps); mxf_interleave_get_packet, mxf_compare_timestamps);
} }
static const AVClass class = { static const AVClass mxf_class = {
.class_name = "mxf", .class_name = "mxf",
.item_name = av_default_item_name, .item_name = av_default_item_name,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
@ -1881,6 +1881,16 @@ static const AVClass class = {
}, },
}; };
static const AVClass mxf_d10_class = {
.class_name = "mxf_d10",
.item_name = av_default_item_name,
.version = LIBAVUTIL_VERSION_INT,
.option = (const AVOption[]){
{TIMECODE_OPT(MXFContext, AV_OPT_FLAG_ENCODING_PARAM)},
{NULL}
},
};
AVOutputFormat ff_mxf_muxer = { AVOutputFormat ff_mxf_muxer = {
.name = "mxf", .name = "mxf",
.long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format"), .long_name = NULL_IF_CONFIG_SMALL("Material eXchange Format"),
@ -1894,7 +1904,7 @@ AVOutputFormat ff_mxf_muxer = {
.write_trailer = mxf_write_footer, .write_trailer = mxf_write_footer,
.flags = AVFMT_NOTIMESTAMPS, .flags = AVFMT_NOTIMESTAMPS,
.interleave_packet = mxf_interleave, .interleave_packet = mxf_interleave,
.priv_class = &class, .priv_class = &mxf_class,
}; };
AVOutputFormat ff_mxf_d10_muxer = { AVOutputFormat ff_mxf_d10_muxer = {
@ -1909,5 +1919,5 @@ AVOutputFormat ff_mxf_d10_muxer = {
.write_trailer = mxf_write_footer, .write_trailer = mxf_write_footer,
.flags = AVFMT_NOTIMESTAMPS, .flags = AVFMT_NOTIMESTAMPS,
.interleave_packet = mxf_interleave, .interleave_packet = mxf_interleave,
.priv_class = &class, .priv_class = &mxf_d10_class,
}; };

@ -33,30 +33,36 @@ static const char* format_to_name(void* ptr)
else return "NULL"; else return "NULL";
} }
static const AVOption *opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags) static void *format_child_next(void *obj, void *prev)
{ {
AVFormatContext *s = obj; AVFormatContext *s = obj;
AVInputFormat *ifmt = NULL; if (!prev && s->priv_data &&
AVOutputFormat *ofmt = NULL; ((s->iformat && s->iformat->priv_class) ||
if (!(search_flags & AV_OPT_SEARCH_FAKE_OBJ) && s->priv_data) { s->oformat && s->oformat->priv_class))
if ((s->iformat && !s->iformat->priv_class) || return s->priv_data;
(s->oformat && !s->oformat->priv_class))
return NULL; return NULL;
return av_opt_find(s->priv_data, name, unit, opt_flags, search_flags);
} }
while ((ifmt = av_iformat_next(ifmt))) { static const AVClass *format_child_class_next(const AVClass *prev)
const AVOption *o; {
AVInputFormat *ifmt = NULL;
AVOutputFormat *ofmt = NULL;
while (prev && (ifmt = av_iformat_next(ifmt)))
if (ifmt->priv_class == prev)
break;
if ((prev && ifmt) || (!prev))
while (ifmt = av_iformat_next(ifmt))
if (ifmt->priv_class)
return ifmt->priv_class;
if (ifmt->priv_class && (o = av_opt_find(&ifmt->priv_class, name, unit, opt_flags, search_flags))) while (prev && (ofmt = av_oformat_next(ofmt)))
return o; if (ofmt->priv_class == prev)
} break;
while ((ofmt = av_oformat_next(ofmt))) { while (ofmt = av_oformat_next(ofmt))
const AVOption *o; if (ofmt->priv_class)
return ofmt->priv_class;
if (ofmt->priv_class && (o = av_opt_find(&ofmt->priv_class, name, unit, opt_flags, search_flags)))
return o;
}
return NULL; return NULL;
} }
@ -67,33 +73,33 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit, i
#define D AV_OPT_FLAG_DECODING_PARAM #define D AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[]={ static const AVOption options[]={
{"probesize", "set probing size", OFFSET(probesize), FF_OPT_TYPE_INT, {.dbl = 5000000 }, 32, INT_MAX, D}, {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT, {.dbl = 5000000 }, 32, INT_MAX, D},
{"muxrate", "set mux rate", OFFSET(mux_rate), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E}, {"muxrate", "set mux rate", OFFSET(mux_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E},
{"packetsize", "set packet size", OFFSET(packet_size), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E}, {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E},
{"fflags", NULL, OFFSET(flags), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, D|E, "fflags"}, {"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, D|E, "fflags"},
{"ignidx", "ignore index", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"}, {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"},
{"genpts", "generate pts", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, "fflags"}, {"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, "fflags"},
{"nofillin", "do not fill in missing values that can be exactly calculated", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOFILLIN }, INT_MIN, INT_MAX, D, "fflags"}, {"nofillin", "do not fill in missing values that can be exactly calculated", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOFILLIN }, INT_MIN, INT_MAX, D, "fflags"},
{"noparse", "disable AVParsers, this needs nofillin too", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOPARSE }, INT_MIN, INT_MAX, D, "fflags"}, {"noparse", "disable AVParsers, this needs nofillin too", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOPARSE }, INT_MIN, INT_MAX, D, "fflags"},
{"igndts", "ignore dts", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, "fflags"}, {"igndts", "ignore dts", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, "fflags"},
#if FF_API_FLAG_RTP_HINT #if FF_API_FLAG_RTP_HINT
{"rtphint", "add rtp hinting (deprecated, use the -movflags rtphint option instead)", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_RTP_HINT }, INT_MIN, INT_MAX, E, "fflags"}, {"rtphint", "add rtp hinting (deprecated, use the -movflags rtphint option instead)", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_RTP_HINT }, INT_MIN, INT_MAX, E, "fflags"},
#endif #endif
{"discardcorrupt", "discard corrupted frames", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"}, {"discardcorrupt", "discard corrupted frames", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"},
{"sortdts", "try to interleave outputted packets by dts", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_SORT_DTS }, INT_MIN, INT_MAX, D, "fflags"}, {"sortdts", "try to interleave outputted packets by dts", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_SORT_DTS }, INT_MIN, INT_MAX, D, "fflags"},
{"keepside", "dont merge side data", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_KEEP_SIDE_DATA }, INT_MIN, INT_MAX, D, "fflags"}, {"keepside", "dont merge side data", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_KEEP_SIDE_DATA }, INT_MIN, INT_MAX, D, "fflags"},
{"latm", "enable RTP MP4A-LATM payload", 0, FF_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_MP4A_LATM }, INT_MIN, INT_MAX, E, "fflags"}, {"latm", "enable RTP MP4A-LATM payload", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_MP4A_LATM }, INT_MIN, INT_MAX, E, "fflags"},
{"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), FF_OPT_TYPE_INT, {.dbl = 5*AV_TIME_BASE }, 0, INT_MAX, D}, {"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT, {.dbl = 5*AV_TIME_BASE }, 0, INT_MAX, D},
{"cryptokey", "decryption key", OFFSET(key), FF_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D}, {"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D},
{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), FF_OPT_TYPE_INT, {.dbl = 1<<20 }, 0, INT_MAX, D}, {"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), AV_OPT_TYPE_INT, {.dbl = 1<<20 }, 0, INT_MAX, D},
{"rtbufsize", "max memory used for buffering real-time frames", OFFSET(max_picture_buffer), FF_OPT_TYPE_INT, {.dbl = 3041280 }, 0, INT_MAX, D}, /* defaults to 1s of 15fps 352x288 YUYV422 video */ {"rtbufsize", "max memory used for buffering real-time frames", OFFSET(max_picture_buffer), AV_OPT_TYPE_INT, {.dbl = 3041280 }, 0, INT_MAX, D}, /* defaults to 1s of 15fps 352x288 YUYV422 video */
{"fdebug", "print specific debug info", OFFSET(debug), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, E|D, "fdebug"}, {"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, INT_MAX, E|D, "fdebug"},
{"ts", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"}, {"ts", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, "fdebug"},
{"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E|D}, {"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E|D},
{"fer", "set error detection aggressivity", OFFSET(error_recognition), FF_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, D, "fer"}, {"fer", "set error detection aggressivity", OFFSET(error_recognition), AV_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, D, "fer"},
{"careful", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, D, "fer"}, {"careful", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, D, "fer"},
{"explode", "abort decoding on error recognition", 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, D, "fer"}, {"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, D, "fer"},
{"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), FF_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX-1, D}, {"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX-1, D},
{NULL}, {NULL},
}; };
@ -106,7 +112,8 @@ static const AVClass av_format_context_class = {
.item_name = format_to_name, .item_name = format_to_name,
.option = options, .option = options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
.opt_find = opt_find, .child_next = format_child_next,
.child_class_next = format_child_class_next,
}; };
static void avformat_get_context_defaults(AVFormatContext *s) static void avformat_get_context_defaults(AVFormatContext *s)

@ -49,8 +49,8 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
} }
static const AVOption pcm_options[] = { static const AVOption pcm_options[] = {
{ "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "channels", "", offsetof(RawAudioDemuxerContext, channels), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, { "channels", "", offsetof(RawAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -171,7 +171,7 @@ fail:
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x) #define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
const AVOption ff_rawvideo_options[] = { const AVOption ff_rawvideo_options[] = {
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC}, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC},
{ NULL }, { NULL },
}; };

@ -47,9 +47,9 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x) #define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption rawvideo_options[] = { static const AVOption rawvideo_options[] = {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "yuv420p"}, 0, 0, DEC }, { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = "yuv420p"}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -97,9 +97,9 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
/* Was the payload type already specified for the RTP muxer? */ /* Was the payload type already specified for the RTP muxer? */
if (ofmt && ofmt->priv_class) { if (ofmt && ofmt->priv_class) {
int payload_type = av_get_int(fmt->priv_data, "payload_type", NULL); int64_t payload_type;
if (payload_type >= 0) if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0)
return payload_type; return (int)payload_type;
} }
/* static payload type */ /* static payload type */

@ -218,7 +218,7 @@ static int rtp_valid_packet_in_sequence(RTPStatistics *s, uint16_t seq)
return 1; return 1;
} }
int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count) int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
{ {
AVIOContext *pb; AVIOContext *pb;
uint8_t *buf; uint8_t *buf;
@ -315,7 +315,7 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
return 0; return 0;
} }
void rtp_send_punch_packets(URLContext* rtp_handle) void ff_rtp_send_punch_packets(URLContext* rtp_handle)
{ {
AVIOContext *pb; AVIOContext *pb;
uint8_t *buf; uint8_t *buf;
@ -359,7 +359,7 @@ void rtp_send_punch_packets(URLContext* rtp_handle)
* MPEG2TS streams to indicate that they should be demuxed inside the * MPEG2TS streams to indicate that they should be demuxed inside the
* rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned) * rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned)
*/ */
RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, int queue_size) RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, int queue_size)
{ {
RTPDemuxContext *s; RTPDemuxContext *s;
@ -407,7 +407,7 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r
} }
void void
rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
RTPDynamicProtocolHandler *handler) RTPDynamicProtocolHandler *handler)
{ {
s->dynamic_protocol_context = ctx; s->dynamic_protocol_context = ctx;
@ -722,7 +722,7 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
* @return 0 if a packet is returned, 1 if a packet is returned and more can follow * @return 0 if a packet is returned, 1 if a packet is returned and more can follow
* (use buf as NULL to read the next). -1 if no packet (error or no more packet). * (use buf as NULL to read the next). -1 if no packet (error or no more packet).
*/ */
int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
uint8_t **bufptr, int len) uint8_t **bufptr, int len)
{ {
int rv = rtp_parse_one_packet(s, pkt, bufptr, len); int rv = rtp_parse_one_packet(s, pkt, bufptr, len);
@ -732,7 +732,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
return rv ? rv : has_next_packet(s); return rv ? rv : has_next_packet(s);
} }
void rtp_parse_close(RTPDemuxContext *s) void ff_rtp_parse_close(RTPDemuxContext *s)
{ {
ff_rtp_reset_packet_queue(s); ff_rtp_reset_packet_queue(s);
if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) { if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) {

@ -38,18 +38,18 @@ typedef struct RTPDynamicProtocolHandler_s RTPDynamicProtocolHandler;
#define RTP_NOTS_VALUE ((uint32_t)-1) #define RTP_NOTS_VALUE ((uint32_t)-1)
typedef struct RTPDemuxContext RTPDemuxContext; typedef struct RTPDemuxContext RTPDemuxContext;
RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, int queue_size); RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, int queue_size);
void rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
RTPDynamicProtocolHandler *handler); RTPDynamicProtocolHandler *handler);
int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
uint8_t **buf, int len); uint8_t **buf, int len);
void rtp_parse_close(RTPDemuxContext *s); void ff_rtp_parse_close(RTPDemuxContext *s);
int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s); int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s);
void ff_rtp_reset_packet_queue(RTPDemuxContext *s); void ff_rtp_reset_packet_queue(RTPDemuxContext *s);
int rtp_get_local_rtp_port(URLContext *h); int ff_rtp_get_local_rtp_port(URLContext *h);
int rtp_get_local_rtcp_port(URLContext *h); int ff_rtp_get_local_rtcp_port(URLContext *h);
int rtp_set_remote_url(URLContext *h, const char *uri); int ff_rtp_set_remote_url(URLContext *h, const char *uri);
/** /**
* Send a dummy packet on both port pairs to set up the connection * Send a dummy packet on both port pairs to set up the connection
@ -62,19 +62,19 @@ int rtp_set_remote_url(URLContext *h, const char *uri);
* The same routine is used with RDT too, even if RDT doesn't use normal * The same routine is used with RDT too, even if RDT doesn't use normal
* RTP packets otherwise. * RTP packets otherwise.
*/ */
void rtp_send_punch_packets(URLContext* rtp_handle); void ff_rtp_send_punch_packets(URLContext* rtp_handle);
/** /**
* some rtp servers assume client is dead if they don't hear from them... * some rtp servers assume client is dead if they don't hear from them...
* so we send a Receiver Report to the provided ByteIO context * so we send a Receiver Report to the provided ByteIO context
* (we don't have access to the rtcp handle from here) * (we don't have access to the rtcp handle from here)
*/ */
int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count); int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count);
/** /**
* Get the file handle for the RTCP socket. * Get the file handle for the RTCP socket.
*/ */
int rtp_get_rtcp_file_handle(URLContext *h); int ff_rtp_get_rtcp_file_handle(URLContext *h);
// these statistics are used for rtcp receiver reports... // these statistics are used for rtcp receiver reports...
typedef struct { typedef struct {

@ -32,7 +32,7 @@
static const AVOption options[] = { static const AVOption options[] = {
FF_RTP_FLAG_OPTS(RTPMuxContext, flags), FF_RTP_FLAG_OPTS(RTPMuxContext, flags),
{ "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM }, { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }, { NULL },
}; };

@ -66,8 +66,8 @@ typedef struct RTPMuxContext RTPMuxContext;
#define FF_RTP_FLAG_MP4A_LATM 1 #define FF_RTP_FLAG_MP4A_LATM 1
#define FF_RTP_FLAG_OPTS(ctx, fieldname) \ #define FF_RTP_FLAG_OPTS(ctx, fieldname) \
{ "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \ { "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
{ "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, FF_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" } \ { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" } \
void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m); void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);

@ -31,6 +31,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
AVFormatContext *rtpctx; AVFormatContext *rtpctx;
int ret; int ret;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
uint8_t *rtpflags;
AVDictionary *opts = NULL;
if (!rtp_format) if (!rtp_format)
return NULL; return NULL;
@ -51,12 +53,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio; rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
rtpctx->flags |= s->flags & AVFMT_FLAG_MP4A_LATM; rtpctx->flags |= s->flags & AVFMT_FLAG_MP4A_LATM;
av_set_parameters(rtpctx, NULL); if (av_opt_get(s, "rtpflags", AV_OPT_SEARCH_CHILDREN, &rtpflags) >= 0)
/* Copy the rtpflags values straight through */ av_dict_set(&opts, "rtpflags", rtpflags, AV_DICT_DONT_STRDUP_VAL);
if (s->oformat->priv_class &&
av_find_opt(s->priv_data, "rtpflags", NULL, 0, 0))
av_set_int(rtpctx->priv_data, "rtpflags",
av_get_int(s->priv_data, "rtpflags", NULL));
/* Set the synchronized start time. */ /* Set the synchronized start time. */
rtpctx->start_time_realtime = s->start_time_realtime; rtpctx->start_time_realtime = s->start_time_realtime;
@ -67,7 +65,8 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
ffio_fdopen(&rtpctx->pb, handle); ffio_fdopen(&rtpctx->pb, handle);
} else } else
ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size);
ret = avformat_write_header(rtpctx, NULL); ret = avformat_write_header(rtpctx, &opts);
av_dict_free(&opts);
if (ret) { if (ret) {
if (handle) { if (handle) {

@ -60,7 +60,7 @@ typedef struct RTPContext {
* @return zero if no error. * @return zero if no error.
*/ */
int rtp_set_remote_url(URLContext *h, const char *uri) int ff_rtp_set_remote_url(URLContext *h, const char *uri)
{ {
RTPContext *s = h->priv_data; RTPContext *s = h->priv_data;
char hostname[256]; char hostname[256];
@ -301,7 +301,7 @@ static int rtp_close(URLContext *h)
* @return the local port number * @return the local port number
*/ */
int rtp_get_local_rtp_port(URLContext *h) int ff_rtp_get_local_rtp_port(URLContext *h)
{ {
RTPContext *s = h->priv_data; RTPContext *s = h->priv_data;
return ff_udp_get_local_port(s->rtp_hd); return ff_udp_get_local_port(s->rtp_hd);
@ -313,7 +313,7 @@ int rtp_get_local_rtp_port(URLContext *h)
* @return the local port number * @return the local port number
*/ */
int rtp_get_local_rtcp_port(URLContext *h) int ff_rtp_get_local_rtcp_port(URLContext *h)
{ {
RTPContext *s = h->priv_data; RTPContext *s = h->priv_data;
return ff_udp_get_local_port(s->rtcp_hd); return ff_udp_get_local_port(s->rtcp_hd);
@ -325,7 +325,7 @@ static int rtp_get_file_handle(URLContext *h)
return s->rtp_fd; return s->rtp_fd;
} }
int rtp_get_rtcp_file_handle(URLContext *h) { int ff_rtp_get_rtcp_file_handle(URLContext *h) {
RTPContext *s = h->priv_data; RTPContext *s = h->priv_data;
return s->rtcp_fd; return s->rtcp_fd;
} }

@ -501,7 +501,7 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
} else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
ff_rdt_parse_close(rtsp_st->transport_priv); ff_rdt_parse_close(rtsp_st->transport_priv);
else if (CONFIG_RTPDEC) else if (CONFIG_RTPDEC)
rtp_parse_close(rtsp_st->transport_priv); ff_rtp_parse_close(rtsp_st->transport_priv);
} }
rtsp_st->transport_priv = NULL; rtsp_st->transport_priv = NULL;
if (rtsp_st->rtp_handle) if (rtsp_st->rtp_handle)
@ -558,7 +558,7 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_protocol_context,
rtsp_st->dynamic_handler); rtsp_st->dynamic_handler);
else if (CONFIG_RTPDEC) else if (CONFIG_RTPDEC)
rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->transport_priv = ff_rtp_parse_open(s, st, rtsp_st->rtp_handle,
rtsp_st->sdp_payload_type, rtsp_st->sdp_payload_type,
(rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay) (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay)
? 0 : RTP_REORDER_QUEUE_DEFAULT_SIZE); ? 0 : RTP_REORDER_QUEUE_DEFAULT_SIZE);
@ -567,7 +567,7 @@ static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} else if (rt->transport != RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) { } else if (rt->transport != RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) {
if (rtsp_st->dynamic_handler) { if (rtsp_st->dynamic_handler) {
rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv, ff_rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_protocol_context,
rtsp_st->dynamic_handler); rtsp_st->dynamic_handler);
} }
@ -808,6 +808,9 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
if (strstr(p, "GET_PARAMETER") && if (strstr(p, "GET_PARAMETER") &&
method && !strcmp(method, "OPTIONS")) method && !strcmp(method, "OPTIONS"))
rt->get_parameter_supported = 1; rt->get_parameter_supported = 1;
} else if (av_stristart(p, "x-Accept-Dynamic-Rate:", &p) && rt) {
p += strspn(p, SPACE_CHARS);
rt->accept_dynamic_rate = atoi(p);
} }
} }
@ -1121,7 +1124,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
goto fail; goto fail;
rtp_opened: rtp_opened:
port = rtp_get_local_rtp_port(rtsp_st->rtp_handle); port = ff_rtp_get_local_rtp_port(rtsp_st->rtp_handle);
have_port: have_port:
snprintf(transport, sizeof(transport) - 1, snprintf(transport, sizeof(transport) - 1,
"%s/UDP;", trans_pref); "%s/UDP;", trans_pref);
@ -1165,6 +1168,8 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"Transport: %s\r\n", "Transport: %s\r\n",
transport); transport);
if (rt->accept_dynamic_rate)
av_strlcat(cmd, "x-Dynamic-Rate: 0\r\n", sizeof(cmd));
if (i == 0 && rt->server_type == RTSP_SERVER_REAL && CONFIG_RTPDEC) { if (i == 0 && rt->server_type == RTSP_SERVER_REAL && CONFIG_RTPDEC) {
char real_res[41], real_csum[9]; char real_res[41], real_csum[9];
ff_rdt_calc_response_and_checksum(real_res, real_csum, ff_rdt_calc_response_and_checksum(real_res, real_csum,
@ -1225,7 +1230,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
reply->transports[0].server_port_min, "%s", options); reply->transports[0].server_port_min, "%s", options);
} }
if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) &&
rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) { ff_rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) {
err = AVERROR_INVALIDDATA; err = AVERROR_INVALIDDATA;
goto fail; goto fail;
} }
@ -1235,7 +1240,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
*/ */
if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat && if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat &&
CONFIG_RTPDEC) CONFIG_RTPDEC)
rtp_send_punch_packets(rtsp_st->rtp_handle); ff_rtp_send_punch_packets(rtsp_st->rtp_handle);
break; break;
} }
case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: { case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: {
@ -1569,7 +1574,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
if (rtsp_st->rtp_handle) { if (rtsp_st->rtp_handle) {
p[max_p].fd = ffurl_get_file_handle(rtsp_st->rtp_handle); p[max_p].fd = ffurl_get_file_handle(rtsp_st->rtp_handle);
p[max_p++].events = POLLIN; p[max_p++].events = POLLIN;
p[max_p].fd = rtp_get_rtcp_file_handle(rtsp_st->rtp_handle); p[max_p].fd = ff_rtp_get_rtcp_file_handle(rtsp_st->rtp_handle);
p[max_p++].events = POLLIN; p[max_p++].events = POLLIN;
} }
} }
@ -1624,7 +1629,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
if (rt->transport == RTSP_TRANSPORT_RDT) { if (rt->transport == RTSP_TRANSPORT_RDT) {
ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0); ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
} else } else
ret = rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0); ret = ff_rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
if (ret == 0) { if (ret == 0) {
rt->cur_transport_priv = NULL; rt->cur_transport_priv = NULL;
return 0; return 0;
@ -1672,13 +1677,13 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
len = udp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE, wait_end); len = udp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE, wait_end);
if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP) if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
rtp_check_and_send_back_rr(rtsp_st->transport_priv, len); ff_rtp_check_and_send_back_rr(rtsp_st->transport_priv, len);
break; break;
} }
if (len == AVERROR(EAGAIN) && first_queue_st && if (len == AVERROR(EAGAIN) && first_queue_st &&
rt->transport == RTSP_TRANSPORT_RTP) { rt->transport == RTSP_TRANSPORT_RTP) {
rtsp_st = first_queue_st; rtsp_st = first_queue_st;
ret = rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0); ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0);
goto end; goto end;
} }
if (len < 0) if (len < 0)
@ -1688,7 +1693,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
if (rt->transport == RTSP_TRANSPORT_RDT) { if (rt->transport == RTSP_TRANSPORT_RDT) {
ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len); ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);
} else { } else {
ret = rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len); ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);
if (ret < 0) { if (ret < 0) {
/* Either bad packet, or a RTCP packet. Check if the /* Either bad packet, or a RTCP packet. Check if the
* first_rtcp_ntp_time field was initialized. */ * first_rtcp_ntp_time field was initialized. */

@ -346,6 +346,9 @@ typedef struct RTSPState {
* Option flags for the chained RTP muxer. * Option flags for the chained RTP muxer.
*/ */
int rtp_muxer_flags; int rtp_muxer_flags;
/** Whether the server accepts the x-Dynamic-Rate header */
int accept_dynamic_rate;
} RTSPState; } RTSPState;
/** /**

@ -389,7 +389,7 @@ static int rtsp_read_close(AVFormatContext *s)
} }
static const AVOption options[] = { static const AVOption options[] = {
{ "initial_pause", "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, { "initial_pause", "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL }, { NULL },
}; };

@ -86,10 +86,10 @@ typedef struct IEC61937Context {
} IEC61937Context; } IEC61937Context;
static const AVOption options[] = { static const AVOption options[] = {
{ "spdif_flags", "IEC 61937 encapsulation flags", offsetof(IEC61937Context, spdif_flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" }, { "spdif_flags", "IEC 61937 encapsulation flags", offsetof(IEC61937Context, spdif_flags), AV_OPT_TYPE_FLAGS, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" },
{ "be", "output in big-endian format (for use as s16be)", 0, FF_OPT_TYPE_CONST, {.dbl = SPDIF_FLAG_BIGENDIAN}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" }, { "be", "output in big-endian format (for use as s16be)", 0, AV_OPT_TYPE_CONST, {.dbl = SPDIF_FLAG_BIGENDIAN}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "spdif_flags" },
{ "dtshd_rate", "mux complete DTS frames in HD mode at the specified IEC958 rate (in Hz, default 0=disabled)", offsetof(IEC61937Context, dtshd_rate), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 768000, AV_OPT_FLAG_ENCODING_PARAM }, { "dtshd_rate", "mux complete DTS frames in HD mode at the specified IEC958 rate (in Hz, default 0=disabled)", offsetof(IEC61937Context, dtshd_rate), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 768000, AV_OPT_FLAG_ENCODING_PARAM },
{ "dtshd_fallback_time", "min secs to strip HD for after an overflow (-1: till the end, default 60)", offsetof(IEC61937Context, dtshd_fallback), FF_OPT_TYPE_INT, {.dbl = 60}, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { "dtshd_fallback_time", "min secs to strip HD for after an overflow (-1: till the end, default 60)", offsetof(IEC61937Context, dtshd_fallback), AV_OPT_TYPE_INT, {.dbl = 60}, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }, { NULL },
}; };

@ -142,9 +142,9 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
#define OFFSET(x) offsetof(TtyDemuxContext, x) #define OFFSET(x) offsetof(TtyDemuxContext, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM #define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame), FF_OPT_TYPE_INT, {.dbl = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}, { "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame), AV_OPT_TYPE_INT, {.dbl = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
{ NULL }, { NULL },
}; };

@ -201,7 +201,7 @@ static int wav_write_trailer(AVFormatContext *s)
#define OFFSET(x) offsetof(WAVContext, x) #define OFFSET(x) offsetof(WAVContext, x)
#define ENC AV_OPT_FLAG_ENCODING_PARAM #define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "write_bext", "Write BEXT chunk.", OFFSET(write_bext), FF_OPT_TYPE_INT, { 0 }, 0, 1, ENC }, { "write_bext", "Write BEXT chunk.", OFFSET(write_bext), AV_OPT_TYPE_INT, { 0 }, 0, 1, ENC },
{ NULL }, { NULL },
}; };

@ -40,8 +40,8 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51 #define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 20 #define LIBAVUTIL_VERSION_MINOR 21
#define LIBAVUTIL_VERSION_MICRO 1 #define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \ LIBAVUTIL_VERSION_MINOR, \

@ -30,7 +30,7 @@
* arbitrary struct of which the first field is a pointer to an * arbitrary struct of which the first field is a pointer to an
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
*/ */
typedef struct { typedef struct AVClass {
/** /**
* The name of the class; usually it is the same name as the * The name of the class; usually it is the same name as the
* context structure type to which the AVClass is associated. * context structure type to which the AVClass is associated.
@ -73,11 +73,19 @@ typedef struct {
int parent_log_context_offset; int parent_log_context_offset;
/** /**
* A function for extended searching, e.g. in possible * Return next AVOptions-enabled child or NULL
* children objects.
*/ */
const struct AVOption* (*opt_find)(void *obj, const char *name, const char *unit, void* (*child_next)(void *obj, void *prev);
int opt_flags, int search_flags);
/**
* Return an AVClass corresponding to next potential
* AVOptions-enabled child.
*
* The difference between child_next and this is that
* child_next iterates over _already existing_ objects, while
* child_class_next iterates over _all possible_ children.
*/
const struct AVClass* (*child_class_next)(const struct AVClass *prev);
} AVClass; } AVClass;
/* av_log API */ /* av_log API */

@ -46,13 +46,35 @@ const AVOption *av_find_opt(void *v, const char *name, const char *unit, int mas
} }
#endif #endif
#if FF_API_OLD_AVOPTIONS
const AVOption *av_next_option(void *obj, const AVOption *last) const AVOption *av_next_option(void *obj, const AVOption *last)
{
return av_opt_next(obj, last);
}
#endif
const AVOption *av_opt_next(void *obj, const AVOption *last)
{ {
if (last && last[1].name) return ++last; if (last && last[1].name) return ++last;
else if (last || !(*(AVClass**)obj)->option->name) return NULL; else if (last || !(*(AVClass**)obj)->option->name) return NULL;
else return (*(AVClass**)obj)->option; else return (*(AVClass**)obj)->option;
} }
static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)
{
switch (o->type) {
case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
case AV_OPT_TYPE_INT: *intnum = *(int *)dst;return 0;
case AV_OPT_TYPE_INT64: *intnum = *(int64_t *)dst;return 0;
case AV_OPT_TYPE_FLOAT: *num = *(float *)dst;return 0;
case AV_OPT_TYPE_DOUBLE: *num = *(double *)dst;return 0;
case AV_OPT_TYPE_RATIONAL: *intnum = ((AVRational*)dst)->num;
*den = ((AVRational*)dst)->den;
return 0;
}
return AVERROR(EINVAL);
}
static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum) static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
{ {
if (o->max*den < num*intnum || o->min*den > num*intnum) { if (o->max*den < num*intnum || o->min*den > num*intnum) {
@ -61,12 +83,12 @@ static int write_number(void *obj, const AVOption *o, void *dst, double num, int
} }
switch (o->type) { switch (o->type) {
case FF_OPT_TYPE_FLAGS: case AV_OPT_TYPE_FLAGS:
case FF_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break; case AV_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break;
case FF_OPT_TYPE_INT64: *(int64_t *)dst= llrint(num/den)*intnum; break; case AV_OPT_TYPE_INT64: *(int64_t *)dst= llrint(num/den)*intnum; break;
case FF_OPT_TYPE_FLOAT: *(float *)dst= num*intnum/den; break; case AV_OPT_TYPE_FLOAT: *(float *)dst= num*intnum/den; break;
case FF_OPT_TYPE_DOUBLE:*(double *)dst= num*intnum/den; break; case AV_OPT_TYPE_DOUBLE:*(double *)dst= num*intnum/den; break;
case FF_OPT_TYPE_RATIONAL: case AV_OPT_TYPE_RATIONAL:
if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den}; if ((int)num == num) *(AVRational*)dst= (AVRational){num*intnum, den};
else *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24); else *(AVRational*)dst= av_d2q(num*intnum/den, 1<<24);
break; break;
@ -137,10 +159,11 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
{ {
int ret = 0, notfirst = 0; int ret = 0, notfirst = 0;
for (;;) { for (;;) {
int i; int i, den = 1;
char buf[256]; char buf[256];
int cmd = 0; int cmd = 0;
double d; double d, num = 1;
int64_t intnum = 1;
if (*val == '+' || *val == '-') if (*val == '+' || *val == '-')
cmd = *(val++); cmd = *(val++);
@ -151,7 +174,7 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
{ {
const AVOption *o_named = av_opt_find(obj, buf, o->unit, 0, 0); const AVOption *o_named = av_opt_find(obj, buf, o->unit, 0, 0);
if (o_named && o_named->type == FF_OPT_TYPE_CONST) if (o_named && o_named->type == AV_OPT_TYPE_CONST)
d = o_named->default_val.dbl; d = o_named->default_val.dbl;
else if (!strcmp(buf, "default")) d = o->default_val.dbl; else if (!strcmp(buf, "default")) d = o->default_val.dbl;
else if (!strcmp(buf, "max" )) d = o->max; else if (!strcmp(buf, "max" )) d = o->max;
@ -166,12 +189,14 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
} }
} }
} }
if (o->type == FF_OPT_TYPE_FLAGS) { if (o->type == AV_OPT_TYPE_FLAGS) {
if (cmd == '+') d = av_get_int(obj, o->name, NULL) | (int64_t)d; read_number(o, dst, NULL, NULL, &intnum);
else if (cmd == '-') d = av_get_int(obj, o->name, NULL) &~(int64_t)d; if (cmd == '+') d = intnum | (int64_t)d;
else if (cmd == '-') d = intnum &~(int64_t)d;
} else { } else {
if (cmd == '+') d = notfirst*av_get_double(obj, o->name, NULL) + d; read_number(o, dst, &num, &den, &intnum);
else if (cmd == '-') d = notfirst*av_get_double(obj, o->name, NULL) - d; if (cmd == '+') d = notfirst*num*intnum/den + d;
else if (cmd == '-') d = notfirst*num*intnum/den - d;
} }
if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0) if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0)
@ -185,63 +210,111 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
return 0; return 0;
} }
#if FF_API_OLD_AVOPTIONS
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out) int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out)
{ {
const AVOption *o = av_opt_find(obj, name, NULL, 0, 0); const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
void *dst;
if (o_out) if (o_out)
*o_out = o; *o_out = o;
if (!o) return av_opt_set(obj, name, val, 0);
}
#endif
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
{
void *dst, *target_obj;
const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND; return AVERROR_OPTION_NOT_FOUND;
if (!val && o->type != FF_OPT_TYPE_STRING) if (!val && o->type != AV_OPT_TYPE_STRING)
return AVERROR(EINVAL); return AVERROR(EINVAL);
dst = ((uint8_t*)obj) + o->offset; dst = ((uint8_t*)target_obj) + o->offset;
switch (o->type) { switch (o->type) {
case FF_OPT_TYPE_STRING: return set_string(obj, o, val, dst); case AV_OPT_TYPE_STRING: return set_string(obj, o, val, dst);
case FF_OPT_TYPE_BINARY: return set_string_binary(obj, o, val, dst); case AV_OPT_TYPE_BINARY: return set_string_binary(obj, o, val, dst);
case FF_OPT_TYPE_FLAGS: case AV_OPT_TYPE_FLAGS:
case FF_OPT_TYPE_INT: case AV_OPT_TYPE_INT:
case FF_OPT_TYPE_INT64: case AV_OPT_TYPE_INT64:
case FF_OPT_TYPE_FLOAT: case AV_OPT_TYPE_FLOAT:
case FF_OPT_TYPE_DOUBLE: case AV_OPT_TYPE_DOUBLE:
case FF_OPT_TYPE_RATIONAL: return set_string_number(obj, o, val, dst); case AV_OPT_TYPE_RATIONAL: return set_string_number(obj, o, val, dst);
} }
av_log(obj, AV_LOG_ERROR, "Invalid option type.\n"); av_log(obj, AV_LOG_ERROR, "Invalid option type.\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
static const AVOption *set_number(void *obj, const char *name, double num, int den, int64_t intnum) #define OPT_EVAL_NUMBER(name, opttype, vartype)\
int av_opt_eval_ ## name(void *obj, const AVOption *o, const char *val, vartype *name ## _out)\
{\
if (!o || o->type != opttype)\
return AVERROR(EINVAL);\
return set_string_number(obj, o, val, name ## _out);\
}
OPT_EVAL_NUMBER(flags, AV_OPT_TYPE_FLAGS, int)
OPT_EVAL_NUMBER(int, AV_OPT_TYPE_INT, int)
OPT_EVAL_NUMBER(int64, AV_OPT_TYPE_INT64, int64_t)
OPT_EVAL_NUMBER(float, AV_OPT_TYPE_FLOAT, float)
OPT_EVAL_NUMBER(double, AV_OPT_TYPE_DOUBLE, double)
OPT_EVAL_NUMBER(q, AV_OPT_TYPE_RATIONAL, AVRational)
static int set_number(void *obj, const char *name, double num, int den, int64_t intnum,
int search_flags)
{
void *dst, *target_obj;
const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND;
dst = ((uint8_t*)target_obj) + o->offset;
return write_number(obj, o, dst, num, den, intnum);
}
#if FF_API_OLD_AVOPTIONS
const AVOption *av_set_double(void *obj, const char *name, double n)
{ {
const AVOption *o = av_opt_find(obj, name, NULL, 0, 0); const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
void *dst; if (set_number(obj, name, n, 1, 1, 0) < 0)
return NULL;
return o;
}
if (!o) const AVOption *av_set_q(void *obj, const char *name, AVRational n)
{
const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
if (set_number(obj, name, n.num, n.den, 1, 0) < 0)
return NULL; return NULL;
return o;
}
dst = ((uint8_t*)obj) + o->offset; const AVOption *av_set_int(void *obj, const char *name, int64_t n)
if (write_number(obj, o, dst, num, den, intnum) < 0) {
const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
if (set_number(obj, name, 1, 1, n, 0) < 0)
return NULL; return NULL;
else
return o; return o;
} }
#endif
const AVOption *av_set_double(void *obj, const char *name, double n) int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
{ {
return set_number(obj, name, n, 1, 1); return set_number(obj, name, 1, 1, val, search_flags);
} }
const AVOption *av_set_q(void *obj, const char *name, AVRational n) int av_opt_set_double(void *obj, const char *name, double val, int search_flags)
{ {
return set_number(obj, name, n.num, n.den, 1); return set_number(obj, name, val, 1, 1, search_flags);
} }
const AVOption *av_set_int(void *obj, const char *name, int64_t n) int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
{ {
return set_number(obj, name, 1, 1, n); return set_number(obj, name, val.num, val.den, 1, search_flags);
} }
#if FF_API_OLD_AVOPTIONS
/** /**
* *
* @param buf a buffer which is used for returning non string values as strings, can be NULL * @param buf a buffer which is used for returning non string values as strings, can be NULL
@ -255,21 +328,21 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
int len, i; int len, i;
if (!o) if (!o)
return NULL; return NULL;
if (o->type != FF_OPT_TYPE_STRING && (!buf || !buf_len)) if (o->type != AV_OPT_TYPE_STRING && (!buf || !buf_len))
return NULL; return NULL;
dst= ((uint8_t*)obj) + o->offset; dst= ((uint8_t*)obj) + o->offset;
if (o_out) *o_out= o; if (o_out) *o_out= o;
switch (o->type) { switch (o->type) {
case FF_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break; case AV_OPT_TYPE_FLAGS: snprintf(buf, buf_len, "0x%08X",*(int *)dst);break;
case FF_OPT_TYPE_INT: snprintf(buf, buf_len, "%d" , *(int *)dst);break; case AV_OPT_TYPE_INT: snprintf(buf, buf_len, "%d" , *(int *)dst);break;
case FF_OPT_TYPE_INT64: snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break; case AV_OPT_TYPE_INT64: snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break;
case FF_OPT_TYPE_FLOAT: snprintf(buf, buf_len, "%f" , *(float *)dst);break; case AV_OPT_TYPE_FLOAT: snprintf(buf, buf_len, "%f" , *(float *)dst);break;
case FF_OPT_TYPE_DOUBLE: snprintf(buf, buf_len, "%f" , *(double *)dst);break; case AV_OPT_TYPE_DOUBLE: snprintf(buf, buf_len, "%f" , *(double *)dst);break;
case FF_OPT_TYPE_RATIONAL: snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; case AV_OPT_TYPE_RATIONAL: snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
case FF_OPT_TYPE_STRING: return *(void**)dst; case AV_OPT_TYPE_STRING: return *(void**)dst;
case FF_OPT_TYPE_BINARY: case AV_OPT_TYPE_BINARY:
len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *)); len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
if (len >= (buf_len + 1)/2) return NULL; if (len >= (buf_len + 1)/2) return NULL;
bin = *(uint8_t**)dst; bin = *(uint8_t**)dst;
@ -279,41 +352,82 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
} }
return buf; return buf;
} }
#endif
static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum) int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
{ {
const AVOption *o = av_opt_find(obj, name, NULL, 0, AV_OPT_SEARCH_CHILDREN); void *dst, *target_obj;
void *dst; const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
if (!o || (o->offset<=0 && o->type != FF_OPT_TYPE_CONST)) uint8_t *bin, buf[128];
goto error; int len, i, ret;
dst= ((uint8_t*)obj) + o->offset; if (!o || !target_obj || (o->offset<=0 && o->type != AV_OPT_TYPE_CONST))
return AVERROR_OPTION_NOT_FOUND;
if (o_out) *o_out= o; dst = (uint8_t*)target_obj + o->offset;
buf[0] = 0;
switch (o->type) { switch (o->type) {
case FF_OPT_TYPE_FLAGS: *intnum= *(unsigned int*)dst;return 0; case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break;
case FF_OPT_TYPE_INT: *intnum= *(int *)dst;return 0; case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break;
case FF_OPT_TYPE_INT64: *intnum= *(int64_t*)dst;return 0; case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break;
case FF_OPT_TYPE_FLOAT: *num= *(float *)dst;return 0; case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break;
case FF_OPT_TYPE_DOUBLE: *num= *(double *)dst;return 0; case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break;
case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num; case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
*den = ((AVRational*)dst)->den; case AV_OPT_TYPE_CONST: ret = snprintf(buf, sizeof(buf), "%f" , o->default_val.dbl);break;
case AV_OPT_TYPE_STRING:
if (*(uint8_t**)dst)
*out_val = av_strdup(*(uint8_t**)dst);
else
*out_val = av_strdup("");
return 0;
case AV_OPT_TYPE_BINARY:
len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
if ((uint64_t)len*2 + 1 > INT_MAX)
return AVERROR(EINVAL);
if (!(*out_val = av_malloc(len*2 + 1)))
return AVERROR(ENOMEM);
bin = *(uint8_t**)dst;
for (i = 0; i < len; i++)
snprintf(*out_val + i*2, 3, "%02X", bin[i]);
return 0;
default:
return AVERROR(EINVAL);
}
if (ret >= sizeof(buf))
return AVERROR(EINVAL);
*out_val = av_strdup(buf);
return 0; return 0;
case FF_OPT_TYPE_CONST: *intnum= o->default_val.dbl;return 0;
} }
static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum,
int search_flags)
{
void *dst, *target_obj;
const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
if (!o || !target_obj)
goto error;
dst = ((uint8_t*)target_obj) + o->offset;
if (o_out) *o_out= o;
return read_number(o, dst, num, den, intnum);
error: error:
*den=*intnum=0; *den=*intnum=0;
return -1; return -1;
} }
#if FF_API_OLD_AVOPTIONS
double av_get_double(void *obj, const char *name, const AVOption **o_out) double av_get_double(void *obj, const char *name, const AVOption **o_out)
{ {
int64_t intnum=1; int64_t intnum=1;
double num=1; double num=1;
int den=1; int den=1;
if (get_number(obj, name, o_out, &num, &den, &intnum) < 0) if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
return NAN; return NAN;
return num*intnum/den; return num*intnum/den;
} }
@ -324,7 +438,7 @@ AVRational av_get_q(void *obj, const char *name, const AVOption **o_out)
double num=1; double num=1;
int den=1; int den=1;
if (get_number(obj, name, o_out, &num, &den, &intnum) < 0) if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
return (AVRational){0, 0}; return (AVRational){0, 0};
if (num == 1.0 && (int)intnum == intnum) if (num == 1.0 && (int)intnum == intnum)
return (AVRational){intnum, den}; return (AVRational){intnum, den};
@ -338,19 +452,62 @@ int64_t av_get_int(void *obj, const char *name, const AVOption **o_out)
double num=1; double num=1;
int den=1; int den=1;
if (get_number(obj, name, o_out, &num, &den, &intnum) < 0) if (get_number(obj, name, o_out, &num, &den, &intnum, 0) < 0)
return -1; return -1;
return num*intnum/den; return num*intnum/den;
} }
#endif
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
{
int64_t intnum = 1;
double num = 1;
int ret, den = 1;
if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
return ret;
*out_val = num*intnum/den;
return 0;
}
int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val)
{
int64_t intnum = 1;
double num = 1;
int ret, den = 1;
if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
return ret;
*out_val = num*intnum/den;
return 0;
}
int av_opt_get_q(void *obj, const char *name, int search_flags, AVRational *out_val)
{
int64_t intnum = 1;
double num = 1;
int ret, den = 1;
if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0)
return ret;
if (num == 1.0 && (int)intnum == intnum)
*out_val = (AVRational){intnum, den};
else
*out_val = av_d2q(num*intnum/den, 1<<24);
return 0;
}
int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name) int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
{ {
const AVOption *field = av_find_opt(obj, field_name, NULL, 0, 0); const AVOption *field = av_opt_find(obj, field_name, NULL, 0, 0);
const AVOption *flag = av_find_opt(obj, flag_name, NULL, 0, 0); const AVOption *flag = av_opt_find(obj, flag_name, NULL, 0, 0);
int64_t res;
if (!field || !flag || flag->type != FF_OPT_TYPE_CONST) if (!field || !flag || flag->type != AV_OPT_TYPE_CONST ||
av_opt_get_int(obj, field_name, 0, &res) < 0)
return 0; return 0;
return av_get_int(obj, field_name, NULL) & (int) flag->default_val.dbl; return res & (int) flag->default_val.dbl;
} }
static void opt_list(void *obj, void *av_log_obj, const char *unit, static void opt_list(void *obj, void *av_log_obj, const char *unit,
@ -358,7 +515,7 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
{ {
const AVOption *opt=NULL; const AVOption *opt=NULL;
while ((opt= av_next_option(obj, opt))) { while ((opt = av_opt_next(obj, opt))) {
if (!(opt->flags & req_flags) || (opt->flags & rej_flags)) if (!(opt->flags & req_flags) || (opt->flags & rej_flags))
continue; continue;
@ -366,43 +523,43 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
* Don't print anything but CONST's on level two. * Don't print anything but CONST's on level two.
* Only print items from the requested unit. * Only print items from the requested unit.
*/ */
if (!unit && opt->type==FF_OPT_TYPE_CONST) if (!unit && opt->type==AV_OPT_TYPE_CONST)
continue; continue;
else if (unit && opt->type!=FF_OPT_TYPE_CONST) else if (unit && opt->type!=AV_OPT_TYPE_CONST)
continue; continue;
else if (unit && opt->type==FF_OPT_TYPE_CONST && strcmp(unit, opt->unit)) else if (unit && opt->type==AV_OPT_TYPE_CONST && strcmp(unit, opt->unit))
continue; continue;
else if (unit && opt->type == FF_OPT_TYPE_CONST) else if (unit && opt->type == AV_OPT_TYPE_CONST)
av_log(av_log_obj, AV_LOG_INFO, " %-15s ", opt->name); av_log(av_log_obj, AV_LOG_INFO, " %-15s ", opt->name);
else else
av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name); av_log(av_log_obj, AV_LOG_INFO, "-%-17s ", opt->name);
switch (opt->type) { switch (opt->type) {
case FF_OPT_TYPE_FLAGS: case AV_OPT_TYPE_FLAGS:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<flags>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<flags>");
break; break;
case FF_OPT_TYPE_INT: case AV_OPT_TYPE_INT:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<int>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<int>");
break; break;
case FF_OPT_TYPE_INT64: case AV_OPT_TYPE_INT64:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<int64>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<int64>");
break; break;
case FF_OPT_TYPE_DOUBLE: case AV_OPT_TYPE_DOUBLE:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<double>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<double>");
break; break;
case FF_OPT_TYPE_FLOAT: case AV_OPT_TYPE_FLOAT:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<float>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<float>");
break; break;
case FF_OPT_TYPE_STRING: case AV_OPT_TYPE_STRING:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<string>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<string>");
break; break;
case FF_OPT_TYPE_RATIONAL: case AV_OPT_TYPE_RATIONAL:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<rational>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<rational>");
break; break;
case FF_OPT_TYPE_BINARY: case AV_OPT_TYPE_BINARY:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<binary>"); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "<binary>");
break; break;
case FF_OPT_TYPE_CONST: case AV_OPT_TYPE_CONST:
default: default:
av_log(av_log_obj, AV_LOG_INFO, "%-7s ", ""); av_log(av_log_obj, AV_LOG_INFO, "%-7s ", "");
break; break;
@ -416,7 +573,7 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
if (opt->help) if (opt->help)
av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help); av_log(av_log_obj, AV_LOG_INFO, " %s", opt->help);
av_log(av_log_obj, AV_LOG_INFO, "\n"); av_log(av_log_obj, AV_LOG_INFO, "\n");
if (opt->unit && opt->type != FF_OPT_TYPE_CONST) { if (opt->unit && opt->type != AV_OPT_TYPE_CONST) {
opt_list(obj, av_log_obj, opt->unit, req_flags, rej_flags); opt_list(obj, av_log_obj, opt->unit, req_flags, rej_flags);
} }
} }
@ -444,44 +601,44 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
{ {
#endif #endif
const AVOption *opt = NULL; const AVOption *opt = NULL;
while ((opt = av_next_option(s, opt)) != NULL) { while ((opt = av_opt_next(s, opt)) != NULL) {
#if FF_API_OLD_AVOPTIONS #if FF_API_OLD_AVOPTIONS
if ((opt->flags & mask) != flags) if ((opt->flags & mask) != flags)
continue; continue;
#endif #endif
switch (opt->type) { switch (opt->type) {
case FF_OPT_TYPE_CONST: case AV_OPT_TYPE_CONST:
/* Nothing to be done here */ /* Nothing to be done here */
break; break;
case FF_OPT_TYPE_FLAGS: case AV_OPT_TYPE_FLAGS:
case FF_OPT_TYPE_INT: { case AV_OPT_TYPE_INT: {
int val; int val;
val = opt->default_val.dbl; val = opt->default_val.dbl;
av_set_int(s, opt->name, val); av_opt_set_int(s, opt->name, val, 0);
} }
break; break;
case FF_OPT_TYPE_INT64: case AV_OPT_TYPE_INT64:
if ((double)(opt->default_val.dbl+0.6) == opt->default_val.dbl) if ((double)(opt->default_val.dbl+0.6) == opt->default_val.dbl)
av_log(s, AV_LOG_DEBUG, "loss of precision in default of %s\n", opt->name); av_log(s, AV_LOG_DEBUG, "loss of precision in default of %s\n", opt->name);
av_set_int(s, opt->name, opt->default_val.dbl); av_opt_set_int(s, opt->name, opt->default_val.dbl, 0);
break; break;
case FF_OPT_TYPE_DOUBLE: case AV_OPT_TYPE_DOUBLE:
case FF_OPT_TYPE_FLOAT: { case AV_OPT_TYPE_FLOAT: {
double val; double val;
val = opt->default_val.dbl; val = opt->default_val.dbl;
av_set_double(s, opt->name, val); av_opt_set_double(s, opt->name, val, 0);
} }
break; break;
case FF_OPT_TYPE_RATIONAL: { case AV_OPT_TYPE_RATIONAL: {
AVRational val; AVRational val;
val = av_d2q(opt->default_val.dbl, INT_MAX); val = av_d2q(opt->default_val.dbl, INT_MAX);
av_set_q(s, opt->name, val); av_opt_set_q(s, opt->name, val, 0);
} }
break; break;
case FF_OPT_TYPE_STRING: case AV_OPT_TYPE_STRING:
av_set_string3(s, opt->name, opt->default_val.str, 1, NULL); av_opt_set(s, opt->name, opt->default_val.str, 0);
break; break;
case FF_OPT_TYPE_BINARY: case AV_OPT_TYPE_BINARY:
/* Cannot set default for binary */ /* Cannot set default for binary */
break; break;
default: default:
@ -504,7 +661,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags)
* set, or a negative value corresponding to an AVERROR code in case * set, or a negative value corresponding to an AVERROR code in case
* of error: * of error:
* AVERROR(EINVAL) if the key/value pair cannot be parsed, * AVERROR(EINVAL) if the key/value pair cannot be parsed,
* the error code issued by av_set_string3() if the key/value pair * the error code issued by av_opt_set() if the key/value pair
* cannot be set * cannot be set
*/ */
static int parse_key_value_pair(void *ctx, const char **buf, static int parse_key_value_pair(void *ctx, const char **buf,
@ -525,7 +682,7 @@ static int parse_key_value_pair(void *ctx, const char **buf,
av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key); av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key);
ret = av_set_string3(ctx, key, val, 1, NULL); ret = av_opt_set(ctx, key, val, 0);
if (ret == AVERROR_OPTION_NOT_FOUND) if (ret == AVERROR_OPTION_NOT_FOUND)
av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key); av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key);
@ -556,8 +713,8 @@ int av_set_options_string(void *ctx, const char *opts,
void av_opt_free(void *obj) void av_opt_free(void *obj)
{ {
const AVOption *o = NULL; const AVOption *o = NULL;
while ((o = av_next_option(obj, o))) while ((o = av_opt_next(obj, o)))
if (o->type == FF_OPT_TYPE_STRING || o->type == FF_OPT_TYPE_BINARY) if (o->type == AV_OPT_TYPE_STRING || o->type == AV_OPT_TYPE_BINARY)
av_freep((uint8_t *)obj + o->offset); av_freep((uint8_t *)obj + o->offset);
} }
@ -568,7 +725,7 @@ int av_opt_set_dict(void *obj, AVDictionary **options)
int ret = 0; int ret = 0;
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) { while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
ret = av_set_string3(obj, t->key, t->value, 1, NULL); ret = av_opt_set(obj, t->key, t->value, 0);
if (ret == AVERROR_OPTION_NOT_FOUND) if (ret == AVERROR_OPTION_NOT_FOUND)
av_dict_set(&tmp, t->key, t->value, 0); av_dict_set(&tmp, t->key, t->value, 0);
else if (ret < 0) { else if (ret < 0) {
@ -585,19 +742,57 @@ int av_opt_set_dict(void *obj, AVDictionary **options)
const AVOption *av_opt_find(void *obj, const char *name, const char *unit, const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags) int opt_flags, int search_flags)
{ {
AVClass *c = *(AVClass**)obj; return av_opt_find2(obj, name, unit, opt_flags, search_flags, NULL);
}
const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags, void **target_obj)
{
const AVClass *c = *(AVClass**)obj;
const AVOption *o = NULL; const AVOption *o = NULL;
if (c->opt_find && search_flags & AV_OPT_SEARCH_CHILDREN && if (search_flags & AV_OPT_SEARCH_CHILDREN) {
(o = c->opt_find(obj, name, unit, opt_flags, search_flags))) if (search_flags & AV_OPT_SEARCH_FAKE_OBJ) {
const AVClass *child = NULL;
while (child = av_opt_child_class_next(c, child))
if (o = av_opt_find2(&child, name, unit, opt_flags, search_flags, NULL))
return o;
} else {
void *child = NULL;
while (child = av_opt_child_next(obj, child))
if (o = av_opt_find2(child, name, unit, opt_flags, search_flags, target_obj))
return o; return o;
}
}
while (o = av_next_option(obj, o)) { while (o = av_opt_next(obj, o)) {
if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags && if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags &&
((!unit && o->type != FF_OPT_TYPE_CONST) || ((!unit && o->type != AV_OPT_TYPE_CONST) ||
(unit && o->type == FF_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)))) (unit && o->type == AV_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)))) {
if (target_obj) {
if (!(search_flags & AV_OPT_SEARCH_FAKE_OBJ))
*target_obj = obj;
else
*target_obj = NULL;
}
return o; return o;
} }
}
return NULL;
}
void *av_opt_child_next(void *obj, void *prev)
{
const AVClass *c = *(AVClass**)obj;
if (c->child_next)
return c->child_next(obj, prev);
return NULL;
}
const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev)
{
if (parent->child_class_next)
return parent->child_class_next(prev);
return NULL; return NULL;
} }
@ -622,14 +817,14 @@ typedef struct TestContext
#define TEST_FLAG_MU 04 #define TEST_FLAG_MU 04
static const AVOption test_options[]= { static const AVOption test_options[]= {
{"num", "set num", OFFSET(num), FF_OPT_TYPE_INT, {0}, 0, 100 }, {"num", "set num", OFFSET(num), AV_OPT_TYPE_INT, {0}, 0, 100 },
{"toggle", "set toggle", OFFSET(toggle), FF_OPT_TYPE_INT, {0}, 0, 1 }, {"toggle", "set toggle", OFFSET(toggle), AV_OPT_TYPE_INT, {0}, 0, 1 },
{"rational", "set rational", OFFSET(rational), FF_OPT_TYPE_RATIONAL, {0}, 0, 10 }, {"rational", "set rational", OFFSET(rational), AV_OPT_TYPE_RATIONAL, {0}, 0, 10 },
{"string", "set string", OFFSET(string), FF_OPT_TYPE_STRING, {0}, CHAR_MIN, CHAR_MAX }, {"string", "set string", OFFSET(string), AV_OPT_TYPE_STRING, {0}, CHAR_MIN, CHAR_MAX },
{"flags", "set flags", OFFSET(flags), FF_OPT_TYPE_FLAGS, {0}, 0, INT_MAX, 0, "flags" }, {"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {0}, 0, INT_MAX, 0, "flags" },
{"cool", "set cool flag ", 0, FF_OPT_TYPE_CONST, {TEST_FLAG_COOL}, INT_MIN, INT_MAX, 0, "flags" }, {"cool", "set cool flag ", 0, AV_OPT_TYPE_CONST, {TEST_FLAG_COOL}, INT_MIN, INT_MAX, 0, "flags" },
{"lame", "set lame flag ", 0, FF_OPT_TYPE_CONST, {TEST_FLAG_LAME}, INT_MIN, INT_MAX, 0, "flags" }, {"lame", "set lame flag ", 0, AV_OPT_TYPE_CONST, {TEST_FLAG_LAME}, INT_MIN, INT_MAX, 0, "flags" },
{"mu", "set mu flag ", 0, FF_OPT_TYPE_CONST, {TEST_FLAG_MU}, INT_MIN, INT_MAX, 0, "flags" }, {"mu", "set mu flag ", 0, AV_OPT_TYPE_CONST, {TEST_FLAG_MU}, INT_MIN, INT_MAX, 0, "flags" },
{NULL}, {NULL},
}; };

@ -30,9 +30,20 @@
#include "rational.h" #include "rational.h"
#include "avutil.h" #include "avutil.h"
#include "dict.h" #include "dict.h"
#include "log.h"
enum AVOptionType{ enum AVOptionType{
FF_OPT_TYPE_FLAGS, AV_OPT_TYPE_FLAGS,
AV_OPT_TYPE_INT,
AV_OPT_TYPE_INT64,
AV_OPT_TYPE_DOUBLE,
AV_OPT_TYPE_FLOAT,
AV_OPT_TYPE_STRING,
AV_OPT_TYPE_RATIONAL,
AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
AV_OPT_TYPE_CONST = 128,
#if FF_API_OLD_AVOPTIONS
FF_OPT_TYPE_FLAGS = 0,
FF_OPT_TYPE_INT, FF_OPT_TYPE_INT,
FF_OPT_TYPE_INT64, FF_OPT_TYPE_INT64,
FF_OPT_TYPE_DOUBLE, FF_OPT_TYPE_DOUBLE,
@ -41,6 +52,7 @@ enum AVOptionType{
FF_OPT_TYPE_RATIONAL, FF_OPT_TYPE_RATIONAL,
FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
FF_OPT_TYPE_CONST=128, FF_OPT_TYPE_CONST=128,
#endif
}; };
/** /**
@ -111,6 +123,7 @@ attribute_deprecated
const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags); const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
#endif #endif
#if FF_API_OLD_AVOPTIONS
/** /**
* Set the field of obj with the given name to value. * Set the field of obj with the given name to value.
* *
@ -135,17 +148,21 @@ const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int m
* AVERROR_OPTION_NOT_FOUND if no matching option exists * AVERROR_OPTION_NOT_FOUND if no matching option exists
* AVERROR(ERANGE) if the value is out of range * AVERROR(ERANGE) if the value is out of range
* AVERROR(EINVAL) if the value is not valid * AVERROR(EINVAL) if the value is not valid
* @deprecated use av_opt_set()
*/ */
attribute_deprecated
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out); int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
const AVOption *av_set_double(void *obj, const char *name, double n); attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
const AVOption *av_set_q(void *obj, const char *name, AVRational n); attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
const AVOption *av_set_int(void *obj, const char *name, int64_t n); attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
double av_get_double(void *obj, const char *name, const AVOption **o_out);
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out); attribute_deprecated double av_get_double(void *obj, const char *name, const AVOption **o_out);
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out); attribute_deprecated AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len); attribute_deprecated int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
const AVOption *av_next_option(void *obj, const AVOption *last); attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
#endif
/** /**
* Show the obj options. * Show the obj options.
@ -221,6 +238,30 @@ int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
*/ */
int av_opt_set_dict(void *obj, struct AVDictionary **options); int av_opt_set_dict(void *obj, struct AVDictionary **options);
/**
* @defgroup opt_eval_funcs Evaluating option strings
* @{
* This group of functions can be used to evaluate option strings
* and get numbers out of them. They do the same thing as av_opt_set(),
* except the result is written into the caller-supplied pointer.
*
* @param obj a struct whose first element is a pointer to AVClass.
* @param o an option for which the string is to be evaluated.
* @param val string to be evaluated.
* @param *_out value of the string will be written here.
*
* @return 0 on success, a negative number on failure.
*/
int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out);
int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out);
int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out);
int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out);
int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out);
int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out);
/**
* @}
*/
#define AV_OPT_SEARCH_CHILDREN 0x0001 /**< Search in possible children of the #define AV_OPT_SEARCH_CHILDREN 0x0001 /**< Search in possible children of the
given object first. */ given object first. */
/** /**
@ -256,4 +297,112 @@ int av_opt_set_dict(void *obj, struct AVDictionary **options);
const AVOption *av_opt_find(void *obj, const char *name, const char *unit, const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags); int opt_flags, int search_flags);
/**
* Look for an option in an object. Consider only options which
* have all the specified flags set.
*
* @param[in] obj A pointer to a struct whose first element is a
* pointer to an AVClass.
* Alternatively a double pointer to an AVClass, if
* AV_OPT_SEARCH_FAKE_OBJ search flag is set.
* @param[in] name The name of the option to look for.
* @param[in] unit When searching for named constants, name of the unit
* it belongs to.
* @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
* @param search_flags A combination of AV_OPT_SEARCH_*.
* @param[out] target_obj if non-NULL, an object to which the option belongs will be
* written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
* in search_flags. This parameter is ignored if search_flags contain
* AV_OPT_SEARCH_FAKE_OBJ.
*
* @return A pointer to the option found, or NULL if no option
* was found.
*/
const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
int opt_flags, int search_flags, void **target_obj);
/**
* Iterate over all AVOptions belonging to obj.
*
* @param obj an AVOptions-enabled struct or a double pointer to an
* AVClass describing it.
* @param prev result of the previous call to av_opt_next() on this object
* or NULL
* @return next AVOption or NULL
*/
const AVOption *av_opt_next(void *obj, const AVOption *prev);
/**
* Iterate over AVOptions-enabled children of obj.
*
* @param prev result of a previous call to this function or NULL
* @return next AVOptions-enabled child or NULL
*/
void *av_opt_child_next(void *obj, void *prev);
/**
* Iterate over potential AVOptions-enabled children of parent.
*
* @param prev result of a previous call to this function or NULL
* @return AVClass corresponding to next potential child or NULL
*/
const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
/**
* @defgroup opt_set_funcs Option setting functions
* @{
* Those functions set the field of obj with the given name to value.
*
* @param[in] obj A struct whose first element is a pointer to an AVClass.
* @param[in] name the name of the field to set
* @param[in] val The value to set. In case of av_opt_set() if the field is not
* of a string type, then the given string is parsed.
* SI postfixes and some named scalars are supported.
* If the field is of a numeric type, it has to be a numeric or named
* scalar. Behavior with more than one scalar and +- infix operators
* is undefined.
* If the field is of a flags type, it has to be a sequence of numeric
* scalars or named flags separated by '+' or '-'. Prefixing a flag
* with '+' causes it to be set without affecting the other flags;
* similarly, '-' unsets a flag.
* @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
* is passed here, then the option may be set on a child of obj.
*
* @return 0 if the value has been set, or an AVERROR code in case of
* error:
* AVERROR_OPTION_NOT_FOUND if no matching option exists
* AVERROR(ERANGE) if the value is out of range
* AVERROR(EINVAL) if the value is not valid
*/
int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
/**
* @}
*/
/**
* @defgroup opt_get_funcs Option getting functions
* @{
* Those functions get a value of the option with the given name from an object.
*
* @param[in] obj a struct whose first element is a pointer to an AVClass.
* @param[in] name name of the option to get.
* @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
* is passed here, then the option may be found in a child of obj.
* @param[out] out_val value of the option will be written here
* @return 0 on success, a negative error code otherwise
*/
/**
* @note the returned string will av_malloc()ed and must be av_free()ed by the caller
*/
int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
/**
* @}
*/
#endif /* AVUTIL_OPT_H */ #endif /* AVUTIL_OPT_H */

@ -34,34 +34,34 @@ static const char * sws_context_to_name(void * ptr)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = { static const AVOption options[] = {
{ "sws_flags", "scaler/cpu flags", OFFSET(flags), FF_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, VE, "sws_flags" }, { "sws_flags", "scaler/cpu flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, VE, "sws_flags" },
{ "fast_bilinear", "fast bilinear", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_FAST_BILINEAR }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "fast_bilinear", "fast bilinear", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_FAST_BILINEAR }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "bilinear", "bilinear", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_BILINEAR }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "bilinear", "bilinear", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_BILINEAR }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "bicubic", "bicubic", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_BICUBIC }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "bicubic", "bicubic", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_BICUBIC }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "experimental", "experimental", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_X }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "experimental", "experimental", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_X }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "neighbor", "nearest neighbor", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_POINT }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "neighbor", "nearest neighbor", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_POINT }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "area", "averaging area", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_AREA }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "area", "averaging area", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_AREA }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "bicublin", "luma bicubic, chroma bilinear", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_BICUBLIN }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "bicublin", "luma bicubic, chroma bilinear", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_BICUBLIN }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "gauss", "gaussian", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_GAUSS }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "gauss", "gaussian", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_GAUSS }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "sinc", "sinc", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_SINC }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "sinc", "sinc", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_SINC }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "lanczos", "lanczos", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_LANCZOS }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "lanczos", "lanczos", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_LANCZOS }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "spline", "natural bicubic spline", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_SPLINE }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "spline", "natural bicubic spline", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_SPLINE }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "print_info", "print info", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_PRINT_INFO }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "print_info", "print info", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_PRINT_INFO }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "accurate_rnd", "accurate rounding", 0, FF_OPT_TYPE_CONST, {.dbl = SWS_ACCURATE_RND }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "accurate_rnd", "accurate rounding", 0, AV_OPT_TYPE_CONST, {.dbl = SWS_ACCURATE_RND }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "full_chroma_int", "full chroma interpolation", 0 , FF_OPT_TYPE_CONST, {.dbl = SWS_FULL_CHR_H_INT }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "full_chroma_int", "full chroma interpolation", 0 , AV_OPT_TYPE_CONST, {.dbl = SWS_FULL_CHR_H_INT }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "full_chroma_inp", "full chroma input", 0 , FF_OPT_TYPE_CONST, {.dbl = SWS_FULL_CHR_H_INP }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "full_chroma_inp", "full chroma input", 0 , AV_OPT_TYPE_CONST, {.dbl = SWS_FULL_CHR_H_INP }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "bitexact", "", 0 , FF_OPT_TYPE_CONST, {.dbl = SWS_BITEXACT }, INT_MIN, INT_MAX, VE, "sws_flags" }, { "bitexact", "", 0 , AV_OPT_TYPE_CONST, {.dbl = SWS_BITEXACT }, INT_MIN, INT_MAX, VE, "sws_flags" },
{ "srcw", "source width" , OFFSET(srcW), FF_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE }, { "srcw", "source width" , OFFSET(srcW), AV_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE },
{ "srch", "source height" , OFFSET(srcH), FF_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE }, { "srch", "source height" , OFFSET(srcH), AV_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE },
{ "dstw", "destination width" , OFFSET(dstW), FF_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE }, { "dstw", "destination width" , OFFSET(dstW), AV_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE },
{ "dsth", "destination height", OFFSET(dstH), FF_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE }, { "dsth", "destination height", OFFSET(dstH), AV_OPT_TYPE_INT, {.dbl = 16 }, 1, INT_MAX, VE },
{ "src_format", "source format" , OFFSET(srcFormat), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, PIX_FMT_NB-1, VE }, { "src_format", "source format" , OFFSET(srcFormat), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, PIX_FMT_NB-1, VE },
{ "dst_format", "destination format", OFFSET(dstFormat), FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, PIX_FMT_NB-1, VE }, { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, PIX_FMT_NB-1, VE },
{ "src_range" , "source range" , OFFSET(srcRange) , FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 1, VE }, { "src_range" , "source range" , OFFSET(srcRange) , AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 1, VE },
{ "dst_range" , "destination range" , OFFSET(dstRange) , FF_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 1, VE }, { "dst_range" , "destination range" , OFFSET(dstRange) , AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 1, VE },
{ "param0" , "scaler param 0" , OFFSET(param[0]) , FF_OPT_TYPE_DOUBLE, {.dbl = SWS_PARAM_DEFAULT}, INT_MIN, INT_MAX, VE }, { "param0" , "scaler param 0" , OFFSET(param[0]) , AV_OPT_TYPE_DOUBLE, {.dbl = SWS_PARAM_DEFAULT}, INT_MIN, INT_MAX, VE },
{ "param1" , "scaler param 1" , OFFSET(param[1]) , FF_OPT_TYPE_DOUBLE, {.dbl = SWS_PARAM_DEFAULT}, INT_MIN, INT_MAX, VE }, { "param1" , "scaler param 1" , OFFSET(param[1]) , AV_OPT_TYPE_DOUBLE, {.dbl = SWS_PARAM_DEFAULT}, INT_MIN, INT_MAX, VE },
{ NULL } { NULL }
}; };

Loading…
Cancel
Save