Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  h263dec: Propagate AV_LOG_ERRORs from slice decoding through frame decoding with sufficient error recognition
  x86: cabac: don't load/store context values in asm
  H.264: optimize CABAC x86 asm for Atom
  vp3/theora: flush after seek.
  doc/fftools-common-opts: wording fixes missing from the previous commit.
  doc: document using AVOptions in fftools.
  cmdutils: add codec_opts parameter to setup_find_stream_info_opts()
  cmdutils: clarify documentation for filter_codec_opts()
  cmdutils: clarify documentation for setup_find_stream_info_opts()
  lavf: add forgotten attribute_deprecated to av_find_stream_info()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 13 years ago
parent
commit
2dd2abe391
10 changed files with 53 additions and 10 deletions
  1. 1 1
      cmdutils.c
  2. 17 3
      cmdutils.h
  3. 2 0
      doc/ffmpeg.texi
  4. 25 0
      doc/fftools-common-opts.texi
  5. 1 1
      ffmpeg.c
  6. 1 1
      ffplay.c
  7. 1 0
      libavcodec/avcodec.h
  8. 3 3
      libavcodec/h263dec.c
  9. 1 1
      libavcodec/h264_cabac.c
  10. 1 0
      libavcodec/options.c

+ 1 - 1
cmdutils.c

@@ -810,7 +810,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int e
     return ret;
 }
 
-AVDictionary **setup_find_stream_info_opts(AVFormatContext *s)
+AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
 {
     int i;
     AVDictionary **opts;

+ 17 - 3
cmdutils.h

@@ -154,13 +154,27 @@ void parse_options(int argc, char **argv, const OptionDef *options,
 
 /**
  * Filter out options for given codec.
+ *
+ * Create a new options dictionary containing only the options from
+ * opts which apply to the codec with ID codec_id.
+ *
+ * @param encoder if non-zero the codec is an encoder, otherwise is a decoder
+ * @return a pointer to the created dictionary
  */
 AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int encoder);
 
-/*
- * Setup AVCodecContext options for avformat_find_stream_info.
+/**
+ * Setup AVCodecContext options for avformat_find_stream_info().
+ *
+ * Create an array of dictionaries, one dictionary for each stream
+ * contained in s.
+ * Each dictionary will contain the options from codec_opts which can
+ * be applied to the corresponding stream codec context.
+ *
+ * @return pointer to the created array of dictionaries, NULL if it
+ * cannot be created
  */
-AVDictionary **setup_find_stream_info_opts(AVFormatContext *s);
+AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts);
 
 /**
  * Print an error message to stderr, indicating filename and a human

+ 2 - 0
doc/ffmpeg.texi

@@ -475,6 +475,8 @@ FF_ER_COMPLIANT
 FF_ER_AGGRESSIVE
 @item 4
 FF_ER_VERY_AGGRESSIVE
+@item 5
+FF_ER_EXPLODE
 @end table
 
 @item -ec @var{bit_mask}

+ 25 - 0
doc/fftools-common-opts.texi

@@ -91,3 +91,28 @@ The use of the environment variable @env{NO_COLOR} is deprecated and
 will be dropped in a following FFmpeg version.
 
 @end table
+
+@section AVOptions
+
+These options are provided directly by the libavformat, libavdevice and
+libavcodec libraries. To see the list of available AVOptions, use the
+@option{-help} option. They are separated into two categories:
+@table @option
+@item generic
+These options can be set for any container, codec or device. Generic options are
+listed under AVFormatContext options for containers/devices and under
+AVCodecContext options for codecs.
+@item private
+These options are specific to the given container, device or codec. Private
+options are listed under their corresponding containers/devices/codecs.
+@end table
+
+For example to write an ID3v2.3 header instead of a default ID3v2.4 to
+an MP3 file, use the @option{id3v2_version} private option of the MP3
+muxer:
+@example
+ffmpeg -i input.flac -id3v2_version 3 out.mp3
+@end example
+
+Note -nooption syntax cannot be used for boolean AVOptions, use -option
+0/-option 1.

+ 1 - 1
ffmpeg.c

@@ -3388,7 +3388,7 @@ static int opt_input_file(const char *opt, const char *filename)
     }
 
     /* Set AVCodecContext options for avformat_find_stream_info */
-    opts = setup_find_stream_info_opts(ic);
+    opts = setup_find_stream_info_opts(ic, codec_opts);
     orig_nb_streams = ic->nb_streams;
 
     /* If not enough info to get the stream parameters, we decode the

+ 1 - 1
ffplay.c

@@ -2332,7 +2332,7 @@ static int read_thread(void *arg)
     if(genpts)
         ic->flags |= AVFMT_FLAG_GENPTS;
 
-    opts = setup_find_stream_info_opts(ic);
+    opts = setup_find_stream_info_opts(ic, codec_opts);
     orig_nb_streams = ic->nb_streams;
 
     err = avformat_find_stream_info(ic, opts);

+ 1 - 0
libavcodec/avcodec.h

@@ -1493,6 +1493,7 @@ typedef struct AVCodecContext {
 #define FF_ER_COMPLIANT       2
 #define FF_ER_AGGRESSIVE      3
 #define FF_ER_VERY_AGGRESSIVE 4
+#define FF_ER_EXPLODE         5
 
     /**
      * Called at the beginning of each frame to get a buffer for it.

+ 3 - 3
libavcodec/h263dec.c

@@ -650,7 +650,7 @@ retry:
     s->mb_x=0;
     s->mb_y=0;
 
-    decode_slice(s);
+    ret = decode_slice(s);
     while(s->mb_y<s->mb_height){
         if(s->msmpeg4_version){
             if(s->slice_height==0 || s->mb_x!=0 || (s->mb_y%s->slice_height)!=0 || get_bits_count(&s->gb) > s->gb.size_in_bits)
@@ -666,7 +666,7 @@ retry:
         if(s->msmpeg4_version<4 && s->h263_pred)
             ff_mpeg4_clean_buffers(s);
 
-        decode_slice(s);
+        if (decode_slice(s) < 0) ret = AVERROR_INVALIDDATA;
     }
 
     if (s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type==AV_PICTURE_TYPE_I)
@@ -730,7 +730,7 @@ assert(s->current_picture.pict_type == s->pict_type);
 av_log(avctx, AV_LOG_DEBUG, "%"PRId64"\n", rdtsc()-time);
 #endif
 
-    return get_consumed_bytes(s, buf_size);
+    return (ret && avctx->error_recognition >= FF_ER_EXPLODE)?ret:get_consumed_bytes(s, buf_size);
 }
 
 AVCodec ff_h263_decoder = {

+ 1 - 1
libavcodec/h264_cabac.c

@@ -1649,7 +1649,7 @@ static av_always_inline void decode_cabac_residual_internal( H264Context *h, DCT
         const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
 #if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE && !defined(BROKEN_RELOCATIONS)
         coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index,
-                                                 last_coeff_ctx_base-significant_coeff_ctx_base, sig_off);
+                                                 last_coeff_ctx_base, sig_off);
     } else {
         coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index,
                                              last_coeff_ctx_base-significant_coeff_ctx_base);

+ 1 - 0
libavcodec/options.c

@@ -184,6 +184,7 @@ static const AVOption options[]={
 {"compliant", NULL, 0, FF_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"},
 {"very_aggressive", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"},
+{"explode", "abort decoding on error recognition", 0, FF_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},
 {"block_align", NULL, OFFSET(block_align), FF_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},

Some files were not shown because too many files changed in this diff