]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Jan 2012 01:23:55 +0000 (02:23 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 11 Jan 2012 01:44:43 +0000 (02:44 +0100)
* qatar/master: (22 commits)
  rv34: frame-level multi-threading
  mpegvideo: claim ownership of referenced pictures
  aacsbr: prevent out of bounds memcpy().
  ipmovie: fix pts for CODEC_ID_INTERPLAY_DPCM
  sierravmd: fix audio pts
  bethsoftvideo: Use bytestream2 functions to prevent buffer overreads.
  bmpenc: support for PIX_FMT_RGB444
  swscale: fix crash in fast_bilinear code when compiled with -mred-zone.
  swscale: specify register type.
  rv34: use get_bits_left()
  avconv: reinitialize the filtergraph on resolution change.
  vsrc_buffer: error on changing frame parameters.
  avconv: fix -copyinkf.
  fate: Update file checksums after the mov muxer change in a78dbada55d6
  movenc: Don't store a nonzero creation time if nothing was set by the caller
  bmpdec: support for rgb444 with bitfields compression
  rgb2rgb: allow conversion for <15 bpp
  doc: fix stray reference to FFmpeg
  v4l2: use C99 struct initializer
  v4l2: poll the file descriptor
  ...

Conflicts:
avconv.c
libavcodec/aacsbr.c
libavcodec/bethsoftvideo.c
libavcodec/kmvc.c
libavdevice/v4l2.c
libavfilter/vsrc_buffer.c
libswscale/swscale_unscaled.c
libswscale/x86/input.asm
tests/ref/acodec/alac
tests/ref/acodec/pcm_s16be
tests/ref/acodec/pcm_s24be
tests/ref/acodec/pcm_s32be
tests/ref/acodec/pcm_s8
tests/ref/lavf/mov
tests/ref/vsynth1/dnxhd_1080i
tests/ref/vsynth1/mpeg4
tests/ref/vsynth1/qtrle
tests/ref/vsynth1/svq1
tests/ref/vsynth2/dnxhd_1080i
tests/ref/vsynth2/mpeg4
tests/ref/vsynth2/qtrle
tests/ref/vsynth2/svq1

Merged-by: Michael Niedermayer <michaelni@gmx.at>
36 files changed:
1  2 
avconv.c
doc/filters.texi
ffmpeg.c
libavcodec/aacsbr.c
libavcodec/bethsoftvideo.c
libavcodec/kmvc.c
libavcodec/mpegvideo.c
libavcodec/rv30.c
libavcodec/rv34.c
libavcodec/rv34.h
libavcodec/rv40.c
libavdevice/v4l2.c
libavfilter/vsrc_buffer.c
libavformat/ipmovie.c
libavformat/movenc.c
libavformat/sierravmd.c
libswscale/x86/input.asm
libswscale/x86/swscale_template.c
tests/ref/acodec/alac
tests/ref/acodec/pcm_s16be
tests/ref/acodec/pcm_s24be
tests/ref/acodec/pcm_s32be
tests/ref/acodec/pcm_s8
tests/ref/lavf/mov
tests/ref/vsynth1/dnxhd_1080i
tests/ref/vsynth1/mpeg4
tests/ref/vsynth1/prores
tests/ref/vsynth1/qtrle
tests/ref/vsynth1/qtrlegray
tests/ref/vsynth1/svq1
tests/ref/vsynth2/dnxhd_1080i
tests/ref/vsynth2/mpeg4
tests/ref/vsynth2/prores
tests/ref/vsynth2/qtrle
tests/ref/vsynth2/qtrlegray
tests/ref/vsynth2/svq1

diff --cc avconv.c
index 9fae43a5c2cbbbe88562bdd547049cd3de06e29f,c96cc7328018de7acbe5131401f3b090e34b8a76..5f0422cc5dda1409d2e751d9450e984b370d0c0e
+++ b/avconv.c
@@@ -636,9 -606,8 +636,8 @@@ static int configure_video_filters(Inpu
          inputs->pad_idx = 0;
          inputs->next    = NULL;
  
 -        if ((ret = avfilter_graph_parse(ost->graph, ost->avfilter, inputs, outputs, NULL)) < 0)
 +        if ((ret = avfilter_graph_parse(ost->graph, ost->avfilter, &inputs, &outputs, NULL)) < 0)
              return ret;
-         av_freep(&ost->avfilter);
      } else {
          if ((ret = avfilter_link(last_filter, 0, ost->output_video_filter, 0)) < 0)
              return ret;
@@@ -1323,32 -1275,23 +1326,33 @@@ static void do_video_resample(OutputStr
                 ist->file_index, ist->st->index,
                 ost->resample_width, ost->resample_height, av_get_pix_fmt_name(ost->resample_pix_fmt),
                 dec->width         , dec->height         , av_get_pix_fmt_name(dec->pix_fmt));
 -        if (!ost->video_resample)
 -            ost->video_resample = 1;
 +        ost->resample_width   = dec->width;
 +        ost->resample_height  = dec->height;
 +        ost->resample_pix_fmt = dec->pix_fmt;
      }
  
 +    ost->video_resample = dec->width   != enc->width  ||
 +                          dec->height  != enc->height ||
 +                          dec->pix_fmt != enc->pix_fmt;
 +
++
      if (ost->video_resample) {
 -        *out_picture = &ost->pict_tmp;
 -        if (resample_changed) {
 +        *out_picture = &ost->resample_frame;
 +        if (!ost->img_resample_ctx || resample_changed) {
 +            /* initialize the destination picture */
 +            if (!ost->resample_frame.data[0]) {
 +                avcodec_get_frame_defaults(&ost->resample_frame);
 +                if (avpicture_alloc((AVPicture *)&ost->resample_frame, enc->pix_fmt,
 +                                    enc->width, enc->height)) {
 +                    fprintf(stderr, "Cannot allocate temp picture, check pix fmt\n");
 +                    exit_program(1);
 +                }
 +            }
              /* initialize a new scaler context */
              sws_freeContext(ost->img_resample_ctx);
 -            ost->img_resample_ctx = sws_getContext(
 -                ist->st->codec->width,
 -                ist->st->codec->height,
 -                ist->st->codec->pix_fmt,
 -                ost->st->codec->width,
 -                ost->st->codec->height,
 -                ost->st->codec->pix_fmt,
 -                ost->sws_flags, NULL, NULL, NULL);
 +            ost->img_resample_ctx = sws_getContext(dec->width, dec->height, dec->pix_fmt,
 +                                                   enc->width, enc->height, enc->pix_fmt,
 +                                                   ost->sws_flags, NULL, NULL, NULL);
              if (ost->img_resample_ctx == NULL) {
                  av_log(NULL, AV_LOG_FATAL, "Cannot get resampling context\n");
                  exit_program(1);
@@@ -2018,9 -1941,29 +2018,30 @@@ static int transcode_video(InputStream 
              continue;
  
  #if CONFIG_AVFILTER
 -        if (ist->st->sample_aspect_ratio.num)
+         resample_changed = ost->resample_width   != decoded_frame->width  ||
+                            ost->resample_height  != decoded_frame->height ||
+                            ost->resample_pix_fmt != decoded_frame->format;
+         if (resample_changed) {
+             av_log(NULL, AV_LOG_INFO,
+                     "Input stream #%d:%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n",
+                     ist->file_index, ist->st->index,
+                     ost->resample_width,  ost->resample_height,  av_get_pix_fmt_name(ost->resample_pix_fmt),
+                     decoded_frame->width, decoded_frame->height, av_get_pix_fmt_name(decoded_frame->format));
+             avfilter_graph_free(&ost->graph);
+             if (configure_video_filters(ist, ost)) {
+                 av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
+                 exit_program(1);
+             }
+             ost->resample_width   = decoded_frame->width;
+             ost->resample_height  = decoded_frame->height;
+             ost->resample_pix_fmt = decoded_frame->format;
+         }
 +        if (!decoded_frame->sample_aspect_ratio.num)
              decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio;
 +        decoded_frame->pts = ist->pts;
          if (ist->st->codec->codec->capabilities & CODEC_CAP_DR1) {
              FrameBuffer      *buf = decoded_frame->opaque;
              AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(
Simple merge
diff --cc ffmpeg.c
index a13e33a5039a840559bfbae992cbe9e448f593eb,0ec3b241caffd2652b110992a3f834f3a47fed52..884abdee6c861131aeb581ff14ba3979443d5b19
+++ b/ffmpeg.c
@@@ -4033,37 -3509,47 +4033,37 @@@ static OutputStream *new_video_stream(O
              }
          }
  
 +        MATCH_PER_STREAM_OPT(forced_key_frames, str, forced_key_frames, oc, st);
          if (forced_key_frames)
 -            parse_forced_key_frames(forced_key_frames, ost, video_enc);
 -    }
 -    if (video_language) {
 -        av_dict_set(&st->metadata, "language", video_language, 0);
 -        av_freep(&video_language);
 +            parse_forced_key_frames(forced_key_frames, ost);
 +
 +        MATCH_PER_STREAM_OPT(force_fps, i, ost->force_fps, oc, st);
 +
 +        ost->top_field_first = -1;
 +        MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st);
 +
-         MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st);
 +#if CONFIG_AVFILTER
 +        MATCH_PER_STREAM_OPT(filters, str, filters, oc, st);
 +        if (filters)
 +            ost->avfilter = av_strdup(filters);
 +#endif
++    } else {
++        MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st);
      }
  
 -    /* reset some key parameters */
 -    video_disable = 0;
 -    av_freep(&video_codec_name);
 -    av_freep(&forced_key_frames);
 -    video_stream_copy = 0;
 -    frame_pix_fmt = PIX_FMT_NONE;
 +    return ost;
  }
  
 -static void new_audio_stream(AVFormatContext *oc, int file_idx)
 +static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc)
  {
 +    int n;
      AVStream *st;
      OutputStream *ost;
 -    AVCodec *codec= NULL;
      AVCodecContext *audio_enc;
 -    enum CodecID codec_id = CODEC_ID_NONE;
  
 -    if(!audio_stream_copy){
 -        if (audio_codec_name) {
 -            codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1);
 -            codec = avcodec_find_encoder_by_name(audio_codec_name);
 -        } else {
 -            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_AUDIO);
 -            codec = avcodec_find_encoder(codec_id);
 -        }
 -    }
 -    ost = new_output_stream(oc, file_idx, codec);
 +    ost = new_output_stream(o, oc, AVMEDIA_TYPE_AUDIO);
      st  = ost->st;
  
 -    ost->bitstream_filters = audio_bitstream_filters;
 -    audio_bitstream_filters= NULL;
 -
 -    st->codec->thread_count= thread_count;
 -
      audio_enc = st->codec;
      audio_enc->codec_type = AVMEDIA_TYPE_AUDIO;
  
Simple merge
index 059947feadf57fe167e563126b8616b5c3d68370,fa0457cc660a9cb9d6a254de75be50e44c3e6206..d80ac166a5608a6d79706d53d56062d21edb8383
@@@ -56,10 -56,9 +57,10 @@@ static int set_palette(BethsoftvidConte
          return AVERROR_INVALIDDATA;
  
      for(a = 0; a < 256; a++){
-         palette[a] = 0xFF << 24 | AV_RB24(&palette_buffer[a * 3]) * 4;
 -        palette[a] = bytestream2_get_be24u(&ctx->g) * 4;
++        palette[a] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->g) * 4;
 +        palette[a] |= palette[a] >> 6 & 0x30303;
      }
-     frame->palette_has_changed = 1;
+     ctx->frame.palette_has_changed = 1;
      return 256*3;
  }
  
index 19f9677649f2366d27e5740453b9f03d0932fff4,2b54b84e9994744c32efa0329542801965211863..20cc2120c58d2d8eca6303fdead4acbdd024efc6
@@@ -295,16 -261,16 +261,16 @@@ static int decode_frame(AVCodecContext 
          return -1;
      }
  
-     header = *buf++;
+     header = bytestream2_get_byte(&ctx->g);
  
      /* blocksize 127 is really palette change event */
-     if (buf[0] == 127) {
-         buf += 3;
+     if (bytestream2_peek_byte(&ctx->g) == 127) {
+         bytestream2_skip(&ctx->g, 3);
          for (i = 0; i < 127; i++) {
-             ctx->pal[i + (header & 0x81)] = 0xFF << 24 | AV_RB24(buf);
-             buf += 4;
 -            ctx->pal[i + (header & 0x81)] = bytestream2_get_be24(&ctx->g);
++            ctx->pal[i + (header & 0x81)] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g);
+             bytestream2_skip(&ctx->g, 1);
          }
-         buf -= 127 * 4 + 3;
+         bytestream2_seek(&ctx->g, -127 * 4 - 3, SEEK_CUR);
      }
  
      if (header & KMVC_KEYFRAME) {
          ctx->pic.palette_has_changed = 1;
          // palette starts from index 1 and has 127 entries
          for (i = 1; i <= ctx->palsize; i++) {
-             ctx->pal[i] = 0xFF << 24 | bytestream_get_be24(&buf);
 -            ctx->pal[i] = bytestream2_get_be24(&ctx->g);
++            ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g);
          }
      }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0b00abbf108c14c9d3a639526ea60a3ef8e1dea2,191decde2aa8e2c1169782d0388a8c44b4be89b7..29ec6afc498f2cb2075b4c99132cb5710c0eac66
  #include "libavutil/parseutils.h"
  #include "libavutil/pixdesc.h"
  #include "libavutil/avstring.h"
+ #include "libavutil/mathematics.h"
  
 +#if CONFIG_LIBV4L2
 +#include <libv4l2.h>
 +#else
 +#define v4l2_open   open
 +#define v4l2_close  close
 +#define v4l2_dup    dup
 +#define v4l2_ioctl  ioctl
 +#define v4l2_read   read
 +#define v4l2_mmap   mmap
 +#define v4l2_munmap munmap
 +#endif
 +
  static const int desired_video_buffers = 256;
  
  #define V4L_ALLFORMATS  3
@@@ -362,14 -331,15 +362,15 @@@ static void list_formats(AVFormatContex
  
  static int mmap_init(AVFormatContext *ctx)
  {
-     struct video_data *s = ctx->priv_data;
-     struct v4l2_requestbuffers req = {0};
      int i, res;
+     struct video_data *s = ctx->priv_data;
+     struct v4l2_requestbuffers req = {
+         .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+         .count  = desired_video_buffers,
+         .memory = V4L2_MEMORY_MMAP
+     };
  
-     req.count = desired_video_buffers;
-     req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-     req.memory = V4L2_MEMORY_MMAP;
 -    res = ioctl(s->fd, VIDIOC_REQBUFS, &req);
 +    res = v4l2_ioctl(s->fd, VIDIOC_REQBUFS, &req);
      if (res < 0) {
          if (errno == EINVAL) {
              av_log(ctx, AV_LOG_ERROR, "Device does not support mmap\n");
      }
  
      for (i = 0; i < req.count; i++) {
-         struct v4l2_buffer buf = {0};
-         buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-         buf.memory = V4L2_MEMORY_MMAP;
-         buf.index = i;
+         struct v4l2_buffer buf = {
+             .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+             .index  = i,
+             .memory = V4L2_MEMORY_MMAP
+         };
 -
 -        res = ioctl(s->fd, VIDIOC_QUERYBUF, &buf);
 +        res = v4l2_ioctl(s->fd, VIDIOC_QUERYBUF, &buf);
          if (res < 0) {
              av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYBUF)\n");
 -
              return AVERROR(errno);
          }
  
@@@ -456,15 -433,23 +457,23 @@@ static void mmap_release_buffer(AVPacke
  static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
  {
      struct video_data *s = ctx->priv_data;
-     struct v4l2_buffer buf = {0};
+     struct v4l2_buffer buf = {
+         .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+         .memory = V4L2_MEMORY_MMAP
+     };
      struct buff_data *buf_descriptor;
+     struct pollfd p = { .fd = s->fd, .events = POLLIN };
      int res;
  
-     buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-     buf.memory = V4L2_MEMORY_MMAP;
+     res = poll(&p, 1, s->timeout);
+     if (res < 0)
+         return AVERROR(errno);
+     if (!(p.revents & (POLLIN | POLLERR | POLLHUP)))
+         return AVERROR(EAGAIN);
  
      /* FIXME: Some special treatment might be needed in case of loss of signal... */
 -    while ((res = ioctl(s->fd, VIDIOC_DQBUF, &buf)) < 0 && (errno == EINTR));
 +    while ((res = v4l2_ioctl(s->fd, VIDIOC_DQBUF, &buf)) < 0 && (errno == EINTR));
      if (res < 0) {
          if (errno == EAGAIN) {
              pkt->size = 0;
@@@ -513,13 -499,13 +522,13 @@@ static int mmap_start(AVFormatContext *
      int i, res;
  
      for (i = 0; i < s->buffers; i++) {
-         struct v4l2_buffer buf = {0};
-         buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-         buf.memory = V4L2_MEMORY_MMAP;
-         buf.index  = i;
+         struct v4l2_buffer buf = {
+             .type   = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+             .index  = i,
+             .memory = V4L2_MEMORY_MMAP
+         };
  
 -        res = ioctl(s->fd, VIDIOC_QBUF, &buf);
 +        res = v4l2_ioctl(s->fd, VIDIOC_QBUF, &buf);
          if (res < 0) {
              av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QBUF): %s\n",
                     strerror(errno));
@@@ -596,15 -582,18 +605,15 @@@ static int v4l2_set_parameters(AVFormat
          av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n",
                 s->standard);
          /* set tv standard */
-         for (i = 0;; i++) {
+         for(i=0;;i++) {
              standard.index = i;
 -            if (ioctl(s->fd, VIDIOC_ENUMSTD, &standard) < 0) {
 -                av_log(s1, AV_LOG_ERROR,
 -                       "The V4L2 driver ioctl set standard(%s) failed\n",
 -                       s->standard);
 -                return AVERROR(EIO);
 -            }
 -
 -            if (!av_strcasecmp(standard.name, s->standard)) {
 +            ret = v4l2_ioctl(s->fd, VIDIOC_ENUMSTD, &standard);
 +            if (ret < 0 || !av_strcasecmp(standard.name, s->standard))
                  break;
 -            }
 +        }
 +        if (ret < 0) {
 +            av_log(s1, AV_LOG_ERROR, "Unknown standard '%s'\n", s->standard);
 +            return ret;
          }
  
          av_log(s1, AV_LOG_DEBUG,
index b43de067b4dd8730bcdf87948ee074644ea2e3b1,178b3e68bba808ec7fd315985d848163ce394730..362449342e66b3953eb2b283ded24f52910de87b
@@@ -35,80 -33,38 +35,86 @@@ typedef struct 
      int               h, w;
      enum PixelFormat  pix_fmt;
      AVRational        time_base;     ///< time_base to set in the output link
 -    AVRational        pixel_aspect;
 +    AVRational        sample_aspect_ratio;
 +    char              sws_param[256];
  } BufferSourceContext;
  
 -int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame,
 -                             int64_t pts, AVRational pixel_aspect)
+ #define CHECK_PARAM_CHANGE(s, c, width, height, format)\
+     if (c->w != width || c->h != height || c->pix_fmt != format) {\
+         av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\
+         return AVERROR(EINVAL);\
+     }
 +int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter,
 +                                        AVFilterBufferRef *picref, int flags)
  {
      BufferSourceContext *c = buffer_filter->priv;
 -
 -    if (c->buf) {
 -        av_log(buffer_filter, AV_LOG_ERROR,
 -               "Buffering several frames is not supported. "
 -               "Please consume all available frames before adding a new one.\n"
 -            );
 -        //return -1;
 +    AVFilterLink *outlink = buffer_filter->outputs[0];
 +    int ret;
 +
 +    if (c->picref) {
 +        if (flags & AV_VSRC_BUF_FLAG_OVERWRITE) {
 +            avfilter_unref_buffer(c->picref);
 +            c->picref = NULL;
 +        } else {
 +            av_log(buffer_filter, AV_LOG_ERROR,
 +                   "Buffering several frames is not supported. "
 +                   "Please consume all available frames before adding a new one.\n");
 +            return AVERROR(EINVAL);
 +        }
      }
  
 -    CHECK_PARAM_CHANGE(buffer_filter, c, frame->width, frame->height, frame->format);
 +    if (picref->video->w != c->w || picref->video->h != c->h || picref->format != c->pix_fmt) {
 +        AVFilterContext *scale = buffer_filter->outputs[0]->dst;
 +        AVFilterLink *link;
 +        char scale_param[1024];
 +
 +        av_log(buffer_filter, AV_LOG_INFO,
 +               "Buffer video input changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n",
 +               c->w, c->h, av_pix_fmt_descriptors[c->pix_fmt].name,
 +               picref->video->w, picref->video->h, av_pix_fmt_descriptors[picref->format].name);
 +
 +        if (!scale || strcmp(scale->filter->name, "scale")) {
 +            AVFilter *f = avfilter_get_by_name("scale");
 +
 +            av_log(buffer_filter, AV_LOG_INFO, "Inserting scaler filter\n");
 +            if ((ret = avfilter_open(&scale, f, "Input equalizer")) < 0)
 +                return ret;
 +
 +            snprintf(scale_param, sizeof(scale_param)-1, "%d:%d:%s", c->w, c->h, c->sws_param);
 +            if ((ret = avfilter_init_filter(scale, scale_param, NULL)) < 0) {
 +                avfilter_free(scale);
 +                return ret;
 +            }
 +
 +            if ((ret = avfilter_insert_filter(buffer_filter->outputs[0], scale, 0, 0)) < 0) {
 +                avfilter_free(scale);
 +                return ret;
 +            }
 +            scale->outputs[0]->time_base = scale->inputs[0]->time_base;
 +
 +            scale->outputs[0]->format= c->pix_fmt;
 +        } else if (!strcmp(scale->filter->name, "scale")) {
 +            snprintf(scale_param, sizeof(scale_param)-1, "%d:%d:%s",
 +                     scale->outputs[0]->w, scale->outputs[0]->h, c->sws_param);
 +            scale->filter->init(scale, scale_param, NULL);
 +        }
 +
 +        c->pix_fmt = scale->inputs[0]->format = picref->format;
 +        c->w       = scale->inputs[0]->w      = picref->video->w;
 +        c->h       = scale->inputs[0]->h      = picref->video->h;
  
 -    c->buf = avfilter_get_video_buffer(buffer_filter->outputs[0], AV_PERM_WRITE,
 -                                       c->w, c->h);
 -    av_image_copy(c->buf->data, c->buf->linesize, frame->data, frame->linesize,
 -                  c->pix_fmt, c->w, c->h);
 +        link = scale->outputs[0];
 +        if ((ret =  link->srcpad->config_props(link)) < 0)
 +            return ret;
 +    }
  
 -    avfilter_copy_frame_props(c->buf, frame);
 -    c->buf->pts                    = pts;
 -    c->buf->video->pixel_aspect    = pixel_aspect;
 +    c->picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
 +                                          picref->video->w, picref->video->h);
 +    av_image_copy(c->picref->data, c->picref->linesize,
 +                  (void*)picref->data, picref->linesize,
 +                  picref->format, picref->video->w, picref->video->h);
 +    avfilter_copy_buffer_ref_props(c->picref, picref);
  
      return 0;
  }
@@@ -125,7 -81,9 +131,9 @@@ int av_buffersrc_buffer(AVFilterContex
          return AVERROR(EINVAL);
      }
  
 -    CHECK_PARAM_CHANGE(s, c, buf->video->w, buf->video->h, buf->format);
++//     CHECK_PARAM_CHANGE(s, c, buf->video->w, buf->video->h, buf->format);
 -    c->buf = buf;
 +    c->picref = buf;
  
      return 0;
  }
Simple merge
Simple merge
Simple merge
index af53dab7d6e498a541357ef6ab9cf03f2b886959,a23cf05301128b03f51ccf735e736ff77718ca80..0e54522ca750c5518b47c960ee551eb805e9c984
@@@ -133,11 -133,11 +133,11 @@@ cglobal %2ToY, 5, 5, %1, dst, unused0, 
  ;      will be the same (i.e. UYVY+AVX), and thus we don't need to
  ;      split the loop in an aligned and unaligned case
  %macro YUYV_TO_UV_FN 2-3
 -cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w
 +cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w
  %ifdef ARCH_X86_64
-     movsxd         wq, r5m
 -    movsxd         wq, dword r4m
++    movsxd         wq, dword r5m
  %else ; x86-32
 -    mov            wq, r4m
 +    mov            wq, r5m
  %endif
      add         dstUq, wq
      add         dstVq, wq
  ; %1 = nr. of XMM registers
  ; %2 = nv12 or nv21
  %macro NVXX_TO_UV_FN 2
 -cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w
 +cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w
  %ifdef ARCH_X86_64
-     movsxd         wq, r5m
 -    movsxd         wq, dword r4m
++    movsxd         wq, dword r5m
  %else ; x86-32
 -    mov            wq, r4m
 +    mov            wq, r5m
  %endif
      add         dstUq, wq
      add         dstVq, wq
Simple merge
index db6393ac46a73f603fb84221957aec699f7a8fcd,cef12d074426f32bb494e172b996a15c7e73970f..6d0f38671b6ada4fde20b5eac0f046de270d83c1
@@@ -1,4 -1,4 +1,4 @@@
- 4fe333ff79e86cca6ba8c109cc08263e *./tests/data/acodec/alac.m4a
 -db1806d9ffd85c168c2c71a28e6d9229 *./tests/data/acodec/alac.m4a
 -389410 ./tests/data/acodec/alac.m4a
++cf9a4b40ab945367cbb0e6cbb4cf37a1 *./tests/data/acodec/alac.m4a
 +389166 ./tests/data/acodec/alac.m4a
  64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/alac.acodec.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index a4d8f1034f9c9be792c86304cfe3aa279eb4ebf4,f7666660fac22491168195001ee68c618ce54bb2..e1e0607eee1b08db48e5f297910d158919f16181
@@@ -1,4 -1,4 +1,4 @@@
- d07e475322765c20b1fcdb822ad5dc04 *./tests/data/acodec/pcm_s16be.mov
 -53c9eb319c778e7ce137667f62384994 *./tests/data/acodec/pcm_s16be.mov
 -1060073 ./tests/data/acodec/pcm_s16be.mov
++4529713e8b744edb3e62c4e688a3f987 *./tests/data/acodec/pcm_s16be.mov
 +1059065 ./tests/data/acodec/pcm_s16be.mov
  64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s16be.acodec.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index 5fb5aeec76a8ff5a6928c368bbd779353b1d26e6,b9fada7e7615471bb9060abed17e81d1b8024b08..8a9029dd241d285194ea7c1250e5c777ce34a8f6
@@@ -1,4 -1,4 +1,4 @@@
- f66d9543a4e04346818e802c4f2d7a30 *./tests/data/acodec/pcm_s24be.mov
 -af8acd2f08e4bbebe7f4bea4d6f59dd6 *./tests/data/acodec/pcm_s24be.mov
 -1589273 ./tests/data/acodec/pcm_s24be.mov
++8a7b79317738f91a137c7f6519c3df72 *./tests/data/acodec/pcm_s24be.mov
 +1588265 ./tests/data/acodec/pcm_s24be.mov
  64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s24be.acodec.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index 89646b4885961f1ca2497ded66c0987a67d8e16c,d6e5205832c1d7ed6bb9471d1583636fd2b2b8dd..e6dc46cee59833ab075599b6a39f60f37063a7d1
@@@ -1,4 -1,4 +1,4 @@@
- 09c919947211de14b3ad0e7603e5b44e *./tests/data/acodec/pcm_s32be.mov
 -63f0e22b4f7c5d61d75047d85f140d52 *./tests/data/acodec/pcm_s32be.mov
 -2118473 ./tests/data/acodec/pcm_s32be.mov
++c9f29c97890f69796faa227c3c08c3d8 *./tests/data/acodec/pcm_s32be.mov
 +2117465 ./tests/data/acodec/pcm_s32be.mov
  64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s32be.acodec.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
index 5fc08f98ce0ba14ccbe825fa056ff517c96bd246,3b550d2916b68814bb7a5a86cb5f1ffed5c937cd..aa5ce11ee031ee73eb261052ebef231e281531c2
@@@ -1,4 -1,4 +1,4 @@@
- 52d8c65c4987227979785d5ac2030175 *./tests/data/acodec/pcm_s8.mov
 -4b3013a3f3c328ecdb617cd88b3fe836 *./tests/data/acodec/pcm_s8.mov
 -530873 ./tests/data/acodec/pcm_s8.mov
++bfd442109b661daf8ee7a468d9d6b944 *./tests/data/acodec/pcm_s8.mov
 +529865 ./tests/data/acodec/pcm_s8.mov
  651d4eb8d98dfcdda96ae6c43d8f156b *./tests/data/pcm_s8.acodec.out.wav
  stddev:  147.89 PSNR: 52.93 MAXDIFF:  255 bytes:  1058400/  1058400
index 77d1abb70f466d5a1a73bbb9bdcf36e3069bf9ba,a4ae2d5532ffb6638e6020d5f31bbc6dea70f636..a28990328baa93782cbeb2f7513bad2eb55eb741
@@@ -1,3 -1,3 +1,3 @@@
- 3340b7ffe1b1d98a50622bd53f786d41 *./tests/data/lavf/lavf.mov
 -6c5472152b46e070ae6da359838e1f86 *./tests/data/lavf/lavf.mov
 -357717 ./tests/data/lavf/lavf.mov
++37c9c1272d9c524b44692e9192d82033 *./tests/data/lavf/lavf.mov
 +357857 ./tests/data/lavf/lavf.mov
  ./tests/data/lavf/lavf.mov CRC=0x2f6a9b26
index 526e4541806a1a0861206bd50d27904c41e0621e,e989eae2a0220b620f25a5942e25a3ce0602cca2..841a0c02cc27ae2da8e44d28a9a96f00c152d1d8
@@@ -1,4 -1,4 +1,4 @@@
- d2621659037803a30b77e3d4f87eb733 *./tests/data/vsynth1/dnxhd-1080i.mov
 -3cfbe36a7dd5b48859b8a569d626ef77 *./tests/data/vsynth1/dnxhd-1080i.mov
 -3031875 ./tests/data/vsynth1/dnxhd-1080i.mov
++153afc6bd83611db4ba0d6d509fc3d74 *./tests/data/vsynth1/dnxhd-1080i.mov
 +3031895 ./tests/data/vsynth1/dnxhd-1080i.mov
  0c651e840f860592f0d5b66030d9fa32 *./tests/data/dnxhd_1080i.vsynth1.out.yuv
  stddev:    6.29 PSNR: 32.15 MAXDIFF:   64 bytes:   760320/  7603200
index fbf3b8fdccbfd3940ba152451caa8870e7a9097a,b318e6f4de958fc6b1ffb8fd4735e8247063429f..88436f617a3b3bab8f10ca445be19905335174b1
@@@ -1,4 -1,4 +1,4 @@@
- f32960be0f05be8b2ed03447e1eaea6f *./tests/data/vsynth1/odivx.mp4
 -59a9e2eed314abface66aaf1b45eb8f2 *./tests/data/vsynth1/odivx.mp4
 -540180 ./tests/data/vsynth1/odivx.mp4
++6ea715a2de70af8d37128ce643e4cca0 *./tests/data/vsynth1/odivx.mp4
 +539996 ./tests/data/vsynth1/odivx.mp4
  8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv
  stddev:    7.97 PSNR: 30.10 MAXDIFF:  105 bytes:  7603200/  7603200
index 6710a6b893394f5371bd4d7635d8b02d30108bed,0000000000000000000000000000000000000000..e0909347a785306f162649a9c75c8eab8822a909
mode 100644,000000..100644
--- /dev/null
@@@ -1,4 -1,0 +1,4 @@@
- 062e1f5ec6ebdbc43ee69e0393221866 *./tests/data/vsynth1/prores.mov
++e8487134a5e4b8351de7ad386fb25e27 *./tests/data/vsynth1/prores.mov
 +5022795 ./tests/data/vsynth1/prores.mov
 +a2e2d1d45341a94ff994d1d92629f778 *./tests/data/prores.vsynth1.out.yuv
 +stddev:    2.47 PSNR: 40.27 MAXDIFF:   31 bytes:  7603200/  7603200
index bf824ec8015f700640671b8af9402aa597ca4545,002ee49883c5f116208c6a3573ee54ba65e3eeda..a684f172bb3ac57a1bf4543b74db632cc44800f6
@@@ -1,4 -1,4 +1,4 @@@
- b67340783a817fe398fd138175c7fa07 *./tests/data/vsynth1/qtrle.mov
 -7d75328a17e04796a39fe9be3a322946 *./tests/data/vsynth1/qtrle.mov
 -15263232 ./tests/data/vsynth1/qtrle.mov
 -243325fb2cae1a9245efd49aff936327 *./tests/data/qtrle.vsynth1.out.yuv
 -stddev:    3.42 PSNR: 37.43 MAXDIFF:   48 bytes:  7603200/  7603200
++54a37ac94abdd95b9e5726a2211e8e1c *./tests/data/vsynth1/qtrle.mov
 +15263072 ./tests/data/vsynth1/qtrle.mov
 +93695a27c24a61105076ca7b1f010bbd *./tests/data/qtrle.vsynth1.out.yuv
 +stddev:    3.42 PSNR: 37.44 MAXDIFF:   48 bytes:  7603200/  7603200
index 74a6216525fc2d9890da11dcd2e559166f1fb44d,0000000000000000000000000000000000000000..cd3d18e6c6185d022972fbc4f6736d55c6081062
mode 100644,000000..100644
--- /dev/null
@@@ -1,4 -1,0 +1,4 @@@
- f0c3cd26e80674a62683685d0508622a *./tests/data/vsynth1/qtrlegray.mov
++7b04fbf0fa29600517d048882583128b *./tests/data/vsynth1/qtrlegray.mov
 +5113268 ./tests/data/vsynth1/qtrlegray.mov
 +29def4aed035ed65d3a89f7d382fccbe *./tests/data/qtrlegray.vsynth1.out.yuv
 +stddev:   25.95 PSNR: 19.85 MAXDIFF:  122 bytes:  7603200/  7603200
index 90d6fc860cce7b5efaffa6aa9c827f8908b3fd5d,3137e3bd9db78e2ccd502d8ea0eaf20422fb1a0f..551f989cbca5b965304b5f2d9179413042063a16
@@@ -1,4 -1,4 +1,4 @@@
- ebaf85e8743ad1f6c2228d473fe16d83 *./tests/data/vsynth1/svq1.mov
 -5c9d8734693f3cab57f61e76b5b6da7d *./tests/data/vsynth1/svq1.mov
 -1334367 ./tests/data/vsynth1/svq1.mov
++0658c40cfef3964c60bb9b05233727de *./tests/data/vsynth1/svq1.mov
 +1334207 ./tests/data/vsynth1/svq1.mov
  9cc35c54b2c77d36bd7e308b393c1f81 *./tests/data/svq1.vsynth1.out.yuv
  stddev:    9.58 PSNR: 28.50 MAXDIFF:  210 bytes:  7603200/  7603200
index 79563be6d187b0fef95c8205c12c79a3170f8787,b9a6faca1bf727645ef061c4c045bf5550999e29..04c593f53d85b7730906359a96333726046f8bcd
@@@ -1,4 -1,4 +1,4 @@@
- af3b282a2194a7e2748df7684330728a *./tests/data/vsynth2/dnxhd-1080i.mov
 -19a91b7da35cecf41e5e3cb322485627 *./tests/data/vsynth2/dnxhd-1080i.mov
 -3031875 ./tests/data/vsynth2/dnxhd-1080i.mov
++677588203650770792b63a66231bd127 *./tests/data/vsynth2/dnxhd-1080i.mov
 +3031895 ./tests/data/vsynth2/dnxhd-1080i.mov
  3c559af629ae0a8fb1a9a0e4b4da7733 *./tests/data/dnxhd_1080i.vsynth2.out.yuv
  stddev:    1.31 PSNR: 45.77 MAXDIFF:   23 bytes:   760320/  7603200
index 726e1d943616d2fb4d3bcbf00491cf2f2e664c90,8ccab866d5e5e7c519feb9093decf64c5fa127aa..e201df8501292c9969b6aef4a5f5f0e8a01f04f1
@@@ -1,4 -1,4 +1,4 @@@
- 4d092ca067362a61b9c96f5f12a1ab5a *./tests/data/vsynth2/odivx.mp4
 -8c9afbf564008a8ce6719cc3546deae1 *./tests/data/vsynth2/odivx.mp4
 -119833 ./tests/data/vsynth2/odivx.mp4
++051ff85797971b9047723044eaec07be *./tests/data/vsynth2/odivx.mp4
 +119649 ./tests/data/vsynth2/odivx.mp4
  90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv
  stddev:    5.34 PSNR: 33.57 MAXDIFF:   83 bytes:  7603200/  7603200
index 88042601ecc643049a9d408f5602c432bcb7bb41,0000000000000000000000000000000000000000..7bbe907b3a65b4f4d95f9358fdf63574d8c507e2
mode 100644,000000..100644
--- /dev/null
@@@ -1,4 -1,0 +1,4 @@@
- 85f16a09120b668d02cb9cce86dfa9b1 *./tests/data/vsynth2/prores.mov
++81988143e6169dbf735bd180bf5a8703 *./tests/data/vsynth2/prores.mov
 +2844034 ./tests/data/vsynth2/prores.mov
 +b5844025c0f4c7c37db702c3213db232 *./tests/data/prores.vsynth2.out.yuv
 +stddev:    1.31 PSNR: 45.77 MAXDIFF:   11 bytes:  7603200/  7603200
index c4cd88729c83738d2a04ea9a842eae004c482ce2,5dd0425a6fbcc68f9b4470f3d145b76a159d1743..4946dd69761c19d0d246ee6044ec7bc0def66225
@@@ -1,4 -1,4 +1,4 @@@
- f18ed8321e19a7cadedc3ba32d71e0ea *./tests/data/vsynth2/qtrle.mov
 -4805f35ca6e03b9279cc18f3f7356366 *./tests/data/vsynth2/qtrle.mov
 -14798419 ./tests/data/vsynth2/qtrle.mov
 -b2418e0e3a9a8619b31219cbcf24dc82 *./tests/data/qtrle.vsynth2.out.yuv
 -stddev:    1.26 PSNR: 46.06 MAXDIFF:   13 bytes:  7603200/  7603200
++04c58848958a0684eba8a816e00dba28 *./tests/data/vsynth2/qtrle.mov
 +14798259 ./tests/data/vsynth2/qtrle.mov
 +98d0e2854731472c5bf13d8638502d0a *./tests/data/qtrle.vsynth2.out.yuv
 +stddev:    1.26 PSNR: 46.10 MAXDIFF:   13 bytes:  7603200/  7603200
index 4d97adce604d85172d4836cd07123ffa07f5b404,0000000000000000000000000000000000000000..1ffdb5bee48b7501d1a1dddb8fcec27594ed961d
mode 100644,000000..100644
--- /dev/null
@@@ -1,4 -1,0 +1,4 @@@
- 799451fc6215c51fc892a2284721b8e7 *./tests/data/vsynth2/qtrlegray.mov
++b9769bd1ff7e3b0fb26dfc7555e789b4 *./tests/data/vsynth2/qtrlegray.mov
 +5111257 ./tests/data/vsynth2/qtrlegray.mov
 +f63b5ebdfdba750e547c25131b0a3fd1 *./tests/data/qtrlegray.vsynth2.out.yuv
 +stddev:   19.42 PSNR: 22.36 MAXDIFF:   72 bytes:  7603200/  7603200
index b8ce85250cdd7b223f221d996e443390572e03ae,8adca6456d2414e3e1ed8901cb4ba2b62e75f178..77c55c10ee2a4d96d371d9b446c9e787ec8a1329
@@@ -1,4 -1,4 +1,4 @@@
- 8d5275bf59aac368d5da11d9c34b8cf2 *./tests/data/vsynth2/svq1.mov
 -138ad38281570f1a3b68d63ed896435d *./tests/data/vsynth2/svq1.mov
 -766851 ./tests/data/vsynth2/svq1.mov
++320a7fbbaecc0989df054bf9678bfdf6 *./tests/data/vsynth2/svq1.mov
 +766691 ./tests/data/vsynth2/svq1.mov
  aa03471dac3f49455a33a2b19fda1098 *./tests/data/svq1.vsynth2.out.yuv
  stddev:    3.23 PSNR: 37.93 MAXDIFF:   61 bytes:  7603200/  7603200