Merge commit '9a07c1332cfe092b57b5758f22b686ca58806c60'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 3 Nov 2012 13:13:45 +0000 (14:13 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 3 Nov 2012 13:13:45 +0000 (14:13 +0100)
* commit '9a07c1332cfe092b57b5758f22b686ca58806c60':
  parser: Move Doxygen documentation to the header files
  PGS subtitles: Expose forced flag
  x86: PMINUB: port to cpuflags

Conflicts:
libavcodec/avcodec.h
libavcodec/pgssubdec.c
libavcodec/version.h
libavcodec/x86/ac3dsp.asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/avcodec.h
libavcodec/dvdsubdec.c
libavcodec/options.c
libavcodec/parser.c
libavcodec/parser.h
libavcodec/pgssubdec.c
libavcodec/version.h
libavcodec/x86/ac3dsp.asm
libavutil/x86/x86util.asm

@@@ -3411,12 -3190,7 +3413,8 @@@ typedef struct AVSubtitleRect 
       * struct.
       */
      char *ass;
-     /**
-      * 1 indicates this subtitle is a forced subtitle.
-      * A forced subtitle should be displayed even when subtitles are hidden.
-      */
-     int forced;
 +
+     int flags;
  } AVSubtitleRect;
  
  typedef struct AVSubtitle {
@@@ -357,13 -334,8 +357,13 @@@ static int decode_dvd_subtitles(DVDSubC
                  sub_header->rects[0]->h = h;
                  sub_header->rects[0]->type = SUBTITLE_BITMAP;
                  sub_header->rects[0]->pict.linesize[0] = w;
-                 sub_header->rects[0]->forced = is_menu;
++                sub_header->rects[0]->flags = is_menu ? AV_SUBTITLE_FLAG_FORCED : 0;
              }
          }
 +        if (next_cmd_pos < cmd_pos) {
 +            av_log(NULL, AV_LOG_ERROR, "Invalid command offset\n");
 +            break;
 +        }
          if (next_cmd_pos == cmd_pos)
              break;
          cmd_pos = next_cmd_pos;
@@@ -242,53 -198,3 +242,54 @@@ const AVClass *avcodec_get_class(void
  {
      return &av_codec_context_class;
  }
- {"forced", "", SROFFSET(forced), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
 +
 +#define FOFFSET(x) offsetof(AVFrame,x)
 +
 +static const AVOption frame_options[]={
 +{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
 +{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
 +{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
 +{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{"format", "", FOFFSET(format), AV_OPT_TYPE_INT, {.i64 = -1 }, 0, INT_MAX, 0},
 +{"channel_layout", "", FOFFSET(channel_layout), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, 0},
 +{"sample_rate", "", FOFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{NULL},
 +};
 +
 +static const AVClass av_frame_class = {
 +    .class_name              = "AVFrame",
 +    .item_name               = NULL,
 +    .option                  = frame_options,
 +    .version                 = LIBAVUTIL_VERSION_INT,
 +};
 +
 +const AVClass *avcodec_get_frame_class(void)
 +{
 +    return &av_frame_class;
 +}
 +
 +#define SROFFSET(x) offsetof(AVSubtitleRect,x)
 +
 +static const AVOption subtitle_rect_options[]={
 +{"x", "", SROFFSET(x), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{"y", "", SROFFSET(y), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{"w", "", SROFFSET(w), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{"h", "", SROFFSET(h), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
 +{"type", "", SROFFSET(type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
++{"flags", "", SROFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, 1, 0, "flags"},
++{"forced", "", SROFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, 1, 0},
 +{NULL},
 +};
 +
 +static const AVClass av_subtitle_rect_class = {
 +    .class_name             = "AVSubtitleRect",
 +    .item_name              = NULL,
 +    .option                 = subtitle_rect_options,
 +    .version                = LIBAVUTIL_VERSION_INT,
 +};
 +
 +const AVClass *avcodec_get_subtitle_rect_class(void)
 +{
 +    return &av_subtitle_rect_class;
 +}
Simple merge
Simple merge
@@@ -402,38 -366,34 +402,38 @@@ static int display_end_segment(AVCodecC
      sub->end_display_time   = 20000;
      sub->format             = 0;
  
 -    sub->rects     = av_mallocz(sizeof(*sub->rects));
 -    sub->rects[0]  = av_mallocz(sizeof(*sub->rects[0]));
 -    sub->num_rects = 1;
 -
 -    if (ctx->presentation.composition_flag & 0x40)
 -        sub->rects[0]->flags |= AV_SUBTITLE_FLAG_FORCED;
 +    sub->num_rects = ctx->presentation.object_count;
 +    sub->rects     = av_mallocz(sizeof(*sub->rects) * sub->num_rects);
 +
 +    for (rect = 0; rect < sub->num_rects; ++rect) {
 +        uint16_t picture_id    = ctx->presentation.objects[rect].picture_id;
 +        sub->rects[rect]       = av_mallocz(sizeof(*sub->rects[rect]));
 +        sub->rects[rect]->x    = ctx->presentation.objects[rect].x;
 +        sub->rects[rect]->y    = ctx->presentation.objects[rect].y;
 +        sub->rects[rect]->w    = ctx->pictures[picture_id].w;
 +        sub->rects[rect]->h    = ctx->pictures[picture_id].h;
 +        sub->rects[rect]->type = SUBTITLE_BITMAP;
 +
 +        /* Process bitmap */
 +        sub->rects[rect]->pict.linesize[0] = ctx->pictures[picture_id].w;
 +        if (ctx->pictures[picture_id].rle) {
 +            if (ctx->pictures[picture_id].rle_remaining_len)
 +                av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",
 +                       ctx->pictures[picture_id].rle_data_len, ctx->pictures[picture_id].rle_remaining_len);
 +            if (decode_rle(avctx, sub, rect, ctx->pictures[picture_id].rle, ctx->pictures[picture_id].rle_data_len) < 0)
 +                return 0;
 +        }
  
 -    sub->rects[0]->x    = ctx->presentation.x;
 -    sub->rects[0]->y    = ctx->presentation.y;
 -    sub->rects[0]->w    = ctx->picture.w;
 -    sub->rects[0]->h    = ctx->picture.h;
 -    sub->rects[0]->type = SUBTITLE_BITMAP;
 +        /* Allocate memory for colors */
 +        sub->rects[rect]->nb_colors    = 256;
 +        sub->rects[rect]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
  
 -    /* Process bitmap */
 -    sub->rects[0]->pict.linesize[0] = ctx->picture.w;
 +        /* Copy the forced flag */
-         sub->rects[rect]->forced = (ctx->presentation.objects[rect].composition & 0x40) != 0;
++        sub->rects[rect]->flags = (ctx->presentation.objects[rect].composition & 0x40) != 0 ? AV_SUBTITLE_FLAG_FORCED : 0;
  
 -    if (ctx->picture.rle) {
 -        if (ctx->picture.rle_remaining_len)
 -            av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",
 -                   ctx->picture.rle_data_len, ctx->picture.rle_remaining_len);
 -        if(decode_rle(avctx, sub, ctx->picture.rle, ctx->picture.rle_data_len) < 0)
 -            return 0;
 +        if (!ctx->forced_subs_only || ctx->presentation.objects[rect].composition & 0x40)
 +        memcpy(sub->rects[rect]->pict.data[1], ctx->clut, sub->rects[rect]->nb_colors * sizeof(uint32_t));
      }
 -    /* Allocate memory for colors */
 -    sub->rects[0]->nb_colors    = 256;
 -    sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
 -
 -    memcpy(sub->rects[0]->pict.data[1], ctx->clut, sub->rects[0]->nb_colors * sizeof(uint32_t));
  
      return 1;
  }
   * Libavcodec version macros.
   */
  
 +#include "libavutil/avutil.h"
 +
  #define LIBAVCODEC_VERSION_MAJOR 54
- #define LIBAVCODEC_VERSION_MINOR 70
 -#define LIBAVCODEC_VERSION_MINOR 33
 -#define LIBAVCODEC_VERSION_MICRO  0
++#define LIBAVCODEC_VERSION_MINOR 71
 +#define LIBAVCODEC_VERSION_MICRO 100
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                 LIBAVCODEC_VERSION_MINOR, \
@@@ -66,9 -66,7 +66,7 @@@ cglobal ac3_exponent_min, 3, 4, 2, exp
  %define LOOP_ALIGN
  INIT_MMX mmx
  AC3_EXPONENT_MIN
 -%if HAVE_MMXEXT
 +%if HAVE_MMXEXT_EXTERNAL
- %define PMINUB PMINUB_MMXEXT
  %define LOOP_ALIGN ALIGN 16
  INIT_MMX mmxext
  AC3_EXPONENT_MIN
Simple merge