From 428c59d9114ac97754f2bc06d07c4d1ba1860464 Mon Sep 17 00:00:00 2001
From: Kostya <kostya.shishkov@gmail.com>
Date: Sat, 13 Aug 2011 16:44:04 +0000
Subject: [PATCH 01/10] avtools: reinitialise filter chain when input video
 stream changes dimensions

Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
 avconv.c | 13 +++++++++++++
 avplay.c | 14 ++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/avconv.c b/avconv.c
index 877079c887..18c5f07380 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1211,7 +1211,20 @@ static void do_video_out(AVFormatContext *s,
         sws_scale(ost->img_resample_ctx, formatted_picture->data, formatted_picture->linesize,
               0, ost->resample_height, final_picture->data, final_picture->linesize);
     }
+#else
+    if (resample_changed) {
+        avfilter_graph_free(&ost->graph);
+        if (configure_video_filters(ist, ost)) {
+            fprintf(stderr, "Error reinitialising filters!\n");
+            exit_program(1);
+        }
+    }
 #endif
+    if (resample_changed) {
+        ost->resample_width   = dec->width;
+        ost->resample_height  = dec->height;
+        ost->resample_pix_fmt = dec->pix_fmt;
+    }
 
     /* duplicates frame if needed */
     for(i=0;i<nb_frames;i++) {
diff --git a/avplay.c b/avplay.c
index e9b58a817f..710c1b5469 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1755,6 +1755,8 @@ static int video_thread(void *arg)
     AVFilterGraph *graph = avfilter_graph_alloc();
     AVFilterContext *filt_out = NULL;
     int64_t pos;
+    int last_w = is->video_st->codec->width;
+    int last_h = is->video_st->codec->height;
 
     if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
         goto the_end;
@@ -1771,6 +1773,18 @@ static int video_thread(void *arg)
         while (is->paused && !is->videoq.abort_request)
             SDL_Delay(10);
 #if CONFIG_AVFILTER
+        if (   last_w != is->video_st->codec->width
+            || last_h != is->video_st->codec->height) {
+            av_dlog(NULL, "Changing size %dx%d -> %dx%d\n", last_w, last_h,
+                    is->video_st->codec->width, is->video_st->codec->height);
+            avfilter_graph_free(&graph);
+            graph = avfilter_graph_alloc();
+            if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
+                goto the_end;
+            filt_out = is->out_video_filter;
+            last_w = is->video_st->codec->width;
+            last_h = is->video_st->codec->height;
+        }
         ret = get_filtered_video_frame(filt_out, frame, &picref, &tb);
         if (picref) {
             pts_int = picref->pts;

From 5c59fa56edc68de348048cc0b1235d7ade23c979 Mon Sep 17 00:00:00 2001
From: Kostya <kostya.shishkov@gmail.com>
Date: Sat, 13 Aug 2011 16:44:21 +0000
Subject: [PATCH 02/10] Turn on resampling on sudden size change instead of
 bailing out during recode.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
 avconv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avconv.c b/avconv.c
index 18c5f07380..74db59fe23 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1186,7 +1186,7 @@ static void do_video_out(AVFormatContext *s,
                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)
-            exit_program(1);
+            ost->video_resample = 1;
     }
 
 #if !CONFIG_AVFILTER

From 2dbdb309ac957059cfe5a4e9e13b7423d70bd89b Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sat, 9 Apr 2011 10:50:03 +0000
Subject: [PATCH 03/10] patch checklist: suggest fate instead of regression
 tests

Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
 doc/developer.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index d75471cb29..25bfe5a7bc 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -314,7 +314,7 @@ send a reminder by email. Your patch should eventually be dealt with.
 
 @enumerate
 @item
-    Do the regression tests pass with the patch applied?
+    Does @code{make fate} pass with the patch applied?
 @item
     Does @code{make checkheaders} pass with the patch applied?
 @item

From 2bfdb34c8a61c96042752dac18499ce8381c1e69 Mon Sep 17 00:00:00 2001
From: Dustin Brody <libav@parsoma.net>
Date: Fri, 12 Aug 2011 01:30:20 -0400
Subject: [PATCH 04/10] mpeg12: remove repeat-field code disabled since May
 2002

Signed-off-by: Diego Biurrun <diego@biurrun.de>
---
 avconv.c            |  2 --
 ffmpeg.c            |  2 --
 libavcodec/mpeg12.c | 12 ------------
 3 files changed, 16 deletions(-)

diff --git a/avconv.c b/avconv.c
index 74db59fe23..9df4779d50 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2295,8 +2295,6 @@ static int transcode(AVFormatContext **output_files,
             }
             assert_codec_experimental(ist->st->codec, 0);
             assert_avoptions(ost->opts);
-            //if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            //    ist->st->codec->flags |= CODEC_FLAG_REPEAT_FIELD;
         }
     }
 
diff --git a/ffmpeg.c b/ffmpeg.c
index 079384b8a6..1443dd3dc8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2391,8 +2391,6 @@ static int transcode(AVFormatContext **output_files,
             }
             assert_codec_experimental(ist->st->codec, 0);
             assert_avoptions(ost->opts);
-            //if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
-            //    ist->st->codec->flags |= CODEC_FLAG_REPEAT_FIELD;
         }
     }
 
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index cb3b815a1b..91eb3f5ece 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2260,18 +2260,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
             return buf_size;
     }
 
-#if 0
-    if (s->repeat_field % 2 == 1) {
-        s->repeat_field++;
-        //fprintf(stderr,"\nRepeating last frame: %d -> %d! pict: %d %d", avctx->frame_number-1, avctx->frame_number,
-        //        s2->picture_number, s->repeat_field);
-        if (avctx->flags & CODEC_FLAG_REPEAT_FIELD) {
-            *data_size = sizeof(AVPicture);
-            goto the_end;
-        }
-    }
-#endif
-
     if(s->mpeg_enc_ctx_allocated==0 && avctx->codec_tag == AV_RL32("VCR2"))
         vcr2_init_sequence(avctx);
 

From e9fb7636114f2d3b99734abaf5136f6c4f1b3db9 Mon Sep 17 00:00:00 2001
From: Kostya Shishkov <kostya.shishkov@gmail.com>
Date: Sun, 14 Aug 2011 20:02:26 +0200
Subject: [PATCH 05/10] Remove redundant and dubious video codec detection by
 its extradata

Signed-off-by: Diego Biurrun <diego@biurrun.de>
---
 libavformat/rmdec.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 3f4d333c47..54267485b7 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -307,16 +307,6 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
 
 //        av_log(s, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2);
         st->codec->time_base.den = fps * st->codec->time_base.num;
-        //XXX: do we really need that?
-        switch(st->codec->extradata[4]>>4){
-        case 1: st->codec->codec_id = CODEC_ID_RV10; break;
-        case 2: st->codec->codec_id = CODEC_ID_RV20; break;
-        case 3: st->codec->codec_id = CODEC_ID_RV30; break;
-        case 4: st->codec->codec_id = CODEC_ID_RV40; break;
-        default:
-            av_log(st->codec, AV_LOG_ERROR, "extra:%02X %02X %02X %02X %02X\n", st->codec->extradata[0], st->codec->extradata[1], st->codec->extradata[2], st->codec->extradata[3], st->codec->extradata[4]);
-            goto fail1;
-        }
     }
 
 skip:

From 0e8696551414d4ea0aab2559f9475d1fe49d08f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@gmx.de>
Date: Sat, 13 Aug 2011 11:58:18 +0200
Subject: [PATCH 06/10] VC-1: fix reading of custom PAR.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Custom PAR num/denum are in 1-256 range.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
---
 libavcodec/vc1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 1f83dd27b8..243bef5bb8 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -485,8 +485,8 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
         if(ar && ar < 14){
             v->s.avctx->sample_aspect_ratio = ff_vc1_pixel_aspect[ar];
         }else if(ar == 15){
-            w = get_bits(gb, 8);
-            h = get_bits(gb, 8);
+            w = get_bits(gb, 8) + 1;
+            h = get_bits(gb, 8) + 1;
             v->s.avctx->sample_aspect_ratio = (AVRational){w, h};
         }
         av_log(v->s.avctx, AV_LOG_DEBUG, "Aspect: %i:%i\n", v->s.avctx->sample_aspect_ratio.num, v->s.avctx->sample_aspect_ratio.den);

From a7c93dae55c045499ffb34a84f8d5031ae594cf9 Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Sun, 17 Jul 2011 08:08:57 +0200
Subject: [PATCH 07/10] jack: add 'channels' private option.

Get rid of AVFormatParameters usage.
---
 libavdevice/jack_audio.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c
index 4af89bda9e..029ace6dc0 100644
--- a/libavdevice/jack_audio.c
+++ b/libavdevice/jack_audio.c
@@ -26,6 +26,7 @@
 
 #include "libavutil/log.h"
 #include "libavutil/fifo.h"
+#include "libavutil/opt.h"
 #include "libavcodec/avcodec.h"
 #include "libavformat/avformat.h"
 #include "libavformat/timefilter.h"
@@ -36,6 +37,7 @@
 #define FIFO_PACKETS_NUM 16
 
 typedef struct {
+    AVClass        *class;
     jack_client_t * client;
     int             activated;
     sem_t           packet_count;
@@ -136,7 +138,7 @@ static int supply_new_packets(JackData *self, AVFormatContext *context)
     return 0;
 }
 
-static int start_jack(AVFormatContext *context, AVFormatParameters *params)
+static int start_jack(AVFormatContext *context)
 {
     JackData *self = context->priv_data;
     jack_status_t status;
@@ -153,7 +155,6 @@ static int start_jack(AVFormatContext *context, AVFormatParameters *params)
     sem_init(&self->packet_count, 0, 0);
 
     self->sample_rate = jack_get_sample_rate(self->client);
-    self->nports      = params->channels;
     self->ports       = av_malloc(self->nports * sizeof(*self->ports));
     self->buffer_size = jack_get_buffer_size(self->client);
 
@@ -225,10 +226,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
     AVStream *stream;
     int test;
 
-    if (params->sample_rate <= 0 || params->channels <= 0)
-        return -1;
-
-    if ((test = start_jack(context, params)))
+    if ((test = start_jack(context)))
         return test;
 
     stream = av_new_stream(context, 0);
@@ -314,6 +312,19 @@ static int audio_read_close(AVFormatContext *context)
     return 0;
 }
 
+#define OFFSET(x) offsetof(JackData, x)
+static const AVOption options[] = {
+    { "channels", "Number of audio channels.", OFFSET(nports), FF_OPT_TYPE_INT, { 2 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { NULL },
+};
+
+static const AVClass jack_indev_class = {
+    .class_name     = "JACK indev",
+    .item_name      = av_default_item_name,
+    .option         = options,
+    .version        = LIBAVUTIL_VERSION_INT,
+};
+
 AVInputFormat ff_jack_demuxer = {
     "jack",
     NULL_IF_CONFIG_SMALL("JACK Audio Connection Kit"),
@@ -323,4 +334,5 @@ AVInputFormat ff_jack_demuxer = {
     audio_read_packet,
     audio_read_close,
     .flags = AVFMT_NOFILE,
+    .priv_class = &jack_indev_class,
 };

From c14fe6bc99eba55c6e52b3f3c606bb458f8a0a8e Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Sun, 17 Jul 2011 07:45:33 +0200
Subject: [PATCH 08/10] lavf,lavd: remove all usage of AVFormatParameters from
 demuxers.

AVFormatParameters are converted into corresponding private options in
av_open_input_file/stream() compat wrappers, so accessing them from
demuxers is redundant.
---
 libavdevice/alsa-audio-dec.c |  8 --------
 libavdevice/bktr.c           | 19 -------------------
 libavdevice/dv1394.c         | 12 ------------
 libavdevice/fbdev.c          |  4 ----
 libavdevice/libdc1394.c      | 15 ---------------
 libavdevice/oss_audio.c      |  7 -------
 libavdevice/sndio_dec.c      |  7 -------
 libavdevice/v4l.c            | 10 ----------
 libavdevice/v4l2.c           | 21 ---------------------
 libavdevice/vfwcap.c         | 11 -----------
 libavdevice/x11grab.c        |  8 --------
 libavformat/img2.c           | 10 ----------
 libavformat/mpegts.c         |  7 -------
 libavformat/rawdec.c         | 22 +---------------------
 libavformat/rtspdec.c        |  5 -----
 libavformat/tty.c            | 12 ------------
 16 files changed, 1 insertion(+), 177 deletions(-)

diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c
index 937f6a6ef7..05f68d3cdc 100644
--- a/libavdevice/alsa-audio-dec.c
+++ b/libavdevice/alsa-audio-dec.c
@@ -60,14 +60,6 @@ static av_cold int audio_read_header(AVFormatContext *s1,
     enum CodecID codec_id;
     snd_pcm_sw_params_t *sw_params;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->sample_rate > 0)
-        s->sample_rate = ap->sample_rate;
-
-    if (ap->channels > 0)
-        s->channels = ap->channels;
-#endif
-
     st = av_new_stream(s1, 0);
     if (!st) {
         av_log(s1, AV_LOG_ERROR, "Cannot add stream\n");
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index f1ae9ea685..7ff46cf8a3 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -251,17 +251,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
     AVRational framerate;
     int ret = 0;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->standard) {
-        if (!strcasecmp(ap->standard, "pal"))
-            s->standard = PAL;
-        else if (!strcasecmp(ap->standard, "secam"))
-            s->standard = SECAM;
-        else if (!strcasecmp(ap->standard, "ntsc"))
-            s->standard = NTSC;
-    }
-#endif
-
     if ((ret = av_parse_video_size(&width, &height, s->video_size)) < 0) {
         av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size);
         goto out;
@@ -281,14 +270,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
         goto out;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        width = ap->width;
-    if (ap->height > 0)
-        height = ap->height;
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
 
     st = av_new_stream(s1, 0);
     if (!st) {
diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c
index 565cf4cc4e..5502fa2dbb 100644
--- a/libavdevice/dv1394.c
+++ b/libavdevice/dv1394.c
@@ -90,18 +90,6 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap
     if (!dv->dv_demux)
         goto failed;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->standard) {
-       if (!strcasecmp(ap->standard, "pal"))
-           dv->format = DV1394_PAL;
-       else
-           dv->format = DV1394_NTSC;
-    }
-
-    if (ap->channel)
-        dv->channel = ap->channel;
-#endif
-
     /* Open and initialize DV1394 device */
     dv->fd = open(context->filename, O_RDONLY);
     if (dv->fd < 0) {
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index eb654aa4b3..57c257f7b6 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -107,10 +107,6 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
         av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", fbdev->framerate);
         return ret;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->time_base.num)
-        fbdev->framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
 
     if (!(st = av_new_stream(avctx, 0)))
         return AVERROR(ENOMEM);
diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c
index e6161a1386..b6f53454a1 100644
--- a/libavdevice/libdc1394.c
+++ b/libavdevice/libdc1394.c
@@ -142,16 +142,6 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
         av_log(c, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", dc1394->framerate);
         goto out;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        width = ap->width;
-    if (ap->height > 0)
-        height = ap->height;
-    if (ap->pix_fmt)
-        pix_fmt = ap->pix_fmt;
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
     dc1394->frame_rate = av_rescale(1000, framerate.num, framerate.den);
 
     for (fmt = dc1394_frame_formats; fmt->width; fmt++)
@@ -212,11 +202,6 @@ static int dc1394_v1_read_header(AVFormatContext *c, AVFormatParameters * ap)
     if (dc1394_read_common(c,ap,&fmt,&fps) != 0)
         return -1;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->channel)
-        dc1394->channel = ap->channel;
-#endif
-
     /* Now let us prep the hardware. */
     dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
     if (!dc1394->handle) {
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c
index 6e25288dba..6df7f34d7e 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -209,13 +209,6 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap)
     AVStream *st;
     int ret;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->sample_rate > 0)
-        s->sample_rate = ap->sample_rate;
-    if (ap->channels > 0)
-        s->channels = ap->channels;
-#endif
-
     st = av_new_stream(s1, 0);
     if (!st) {
         return AVERROR(ENOMEM);
diff --git a/libavdevice/sndio_dec.c b/libavdevice/sndio_dec.c
index 2690ee395c..40e923660e 100644
--- a/libavdevice/sndio_dec.c
+++ b/libavdevice/sndio_dec.c
@@ -34,13 +34,6 @@ static av_cold int audio_read_header(AVFormatContext *s1,
     AVStream *st;
     int ret;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->sample_rate > 0)
-        s->sample_rate = ap->sample_rate;
-    if (ap->channels > 0)
-        s->channels = ap->channels;
-#endif
-
     st = av_new_stream(s1, 0);
     if (!st)
         return AVERROR(ENOMEM);
diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c
index 1be7adf49d..b0f0452d8e 100644
--- a/libavdevice/v4l.c
+++ b/libavdevice/v4l.c
@@ -142,16 +142,6 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
 
     /* set tv standard */
     if (!ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
-#if FF_API_FORMAT_PARAMETERS
-        if (ap->standard) {
-            if (!strcasecmp(ap->standard, "pal"))
-                s->standard = VIDEO_MODE_PAL;
-            else if (!strcasecmp(ap->standard, "secam"))
-                s->standard = VIDEO_MODE_SECAM;
-            else
-                s->standard = VIDEO_MODE_NTSC;
-        }
-#endif
         tuner.mode = s->standard;
         ioctl(video_fd, VIDIOCSTUNER, &tuner);
     }
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 072be48d40..7a501a901c 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -463,12 +463,6 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
         av_log(s1, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", s->framerate);
         return ret;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->channel > 0)
-        s->channel = ap->channel;
-    if (ap->time_base.num)
-        framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
 
     /* set tv video input */
     memset (&input, 0, sizeof (input));
@@ -486,13 +480,6 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
         return AVERROR(EIO);
     }
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->standard) {
-        av_freep(&s->standard);
-        s->standard = av_strdup(ap->standard);
-    }
-#endif
-
     if (s->standard) {
         av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n",
                s->standard);
@@ -609,14 +596,6 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         res = AVERROR(EINVAL);
         goto out;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        s->width  = ap->width;
-    if (ap->height > 0)
-        s->height = ap->height;
-    if (ap->pix_fmt)
-        pix_fmt = ap->pix_fmt;
-#endif
 
     capabilities = 0;
     s->fd = device_open(s1, &capabilities);
diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c
index 80f9d00e9c..47a9ebeb9c 100644
--- a/libavdevice/vfwcap.c
+++ b/libavdevice/vfwcap.c
@@ -267,11 +267,6 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
         return AVERROR(EIO);
     }
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->time_base.num)
-        framerate_q = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
-
     ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0);
     if(!ctx->hwnd) {
         av_log(s, AV_LOG_ERROR, "Could not create capture window.\n");
@@ -329,12 +324,6 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
             goto fail_bi;
         }
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        bi->bmiHeader.biWidth = ap->width;
-    if (ap->height > 0)
-        bi->bmiHeader.biHeight = ap->height;
-#endif
 
     if (0) {
         /* For testing yet unsupported compressions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 09f6b51161..5cc32dc20d 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -183,14 +183,6 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         av_log(s1, AV_LOG_ERROR, "Could not parse framerate: %s.\n", x11grab->framerate);
         goto out;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        x11grab->width = ap->width;
-    if (ap->height > 0)
-        x11grab->height = ap->height;
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
     av_log(s1, AV_LOG_INFO, "device: %s -> display: %s x: %d y: %d width: %d height: %d\n",
            s1->filename, param, x_off, y_off, x11grab->width, x11grab->height);
 
diff --git a/libavformat/img2.c b/libavformat/img2.c
index a4f39e7256..935d763288 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -233,16 +233,6 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
         av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate);
         return ret;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->pix_fmt != PIX_FMT_NONE)
-        pix_fmt = ap->pix_fmt;
-    if (ap->width > 0)
-        width = ap->width;
-    if (ap->height > 0)
-        height = ap->height;
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
 
 #if FF_API_LOOP_INPUT
     if (s1->loop_input)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2bc66ac685..f22edec81a 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1508,13 +1508,6 @@ static int mpegts_read_header(AVFormatContext *s,
     int len;
     int64_t pos;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap) {
-        if (ap->mpeg2ts_compute_pcr)
-            ts->mpeg2ts_compute_pcr = ap->mpeg2ts_compute_pcr;
-    }
-#endif
-
     /* read the first 1024 bytes to get packet size */
     pos = avio_tell(pb);
     len = avio_read(pb, buf, sizeof(buf));
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 8f3fecb1e7..76ab09c0e5 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -49,13 +49,7 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
         case AVMEDIA_TYPE_AUDIO: {
             RawAudioDemuxerContext *s1 = s->priv_data;
 
-#if FF_API_FORMAT_PARAMETERS
-            if (ap->sample_rate)
-                st->codec->sample_rate = ap->sample_rate;
-            if (ap->channels)
-                st->codec->channels    = ap->channels;
-            else st->codec->channels   = 1;
-#endif
+            st->codec->channels = 1;
 
             if (s1->sample_rate)
                 st->codec->sample_rate = s1->sample_rate;
@@ -87,16 +81,6 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
                 av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
                 goto fail;
             }
-#if FF_API_FORMAT_PARAMETERS
-            if (ap->width > 0)
-                width = ap->width;
-            if (ap->height > 0)
-                height = ap->height;
-            if (ap->pix_fmt)
-                pix_fmt = ap->pix_fmt;
-            if (ap->time_base.num)
-                framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
             av_set_pts_info(st, 64, framerate.den, framerate.num);
             st->codec->width  = width;
             st->codec->height = height;
@@ -170,10 +154,6 @@ int ff_raw_video_read_header(AVFormatContext *s,
         av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate);
         goto fail;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
 
     st->codec->time_base = (AVRational){framerate.den, framerate.num};
     av_set_pts_info(st, 64, 1, 1200000);
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 430c086544..88daa9df1a 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -164,11 +164,6 @@ static int rtsp_read_header(AVFormatContext *s,
         return AVERROR(ENOMEM);
     rt->real_setup = rt->real_setup_cache + s->nb_streams;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->initial_pause)
-        rt->initial_pause = ap->initial_pause;
-#endif
-
     if (rt->initial_pause) {
          /* do not start immediately */
     } else {
diff --git a/libavformat/tty.c b/libavformat/tty.c
index ee6b2f1334..58e2946346 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -95,23 +95,11 @@ static int read_header(AVFormatContext *avctx,
         av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate);
         goto fail;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        width = ap->width;
-    if (ap->height > 0)
-        height = ap->height;
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
     st->codec->width  = width;
     st->codec->height = height;
     av_set_pts_info(st, 60, framerate.den, framerate.num);
 
     /* simulate tty display speed */
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->sample_rate)
-        s->chars_per_frame = ap->sample_rate;
-#endif
     s->chars_per_frame = FFMAX(av_q2d(st->time_base)*s->chars_per_frame, 1);
 
     if (avctx->pb->seekable) {

From 48f7163f13471cc74fb333bb83d1132c8ffdc1ee Mon Sep 17 00:00:00 2001
From: Alex Converse <alex.converse@gmail.com>
Date: Sat, 13 Aug 2011 20:02:37 -0700
Subject: [PATCH 09/10] dsputil_mmx: Honor HAVE_AMD3DNOW

---
 libavcodec/x86/dsputil_mmx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 0cd9601853..2fb75cb535 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -2676,12 +2676,12 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
             c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmx2;
 #endif
 #if HAVE_7REGS
-            if( mm_flags&AV_CPU_FLAG_3DNOW )
+            if (HAVE_AMD3DNOW && (mm_flags & AV_CPU_FLAG_3DNOW))
                 c->add_hfyu_median_prediction = add_hfyu_median_prediction_cmov;
 #endif
 
             c->add_png_paeth_prediction= add_png_paeth_prediction_mmx2;
-        } else if (mm_flags & AV_CPU_FLAG_3DNOW) {
+        } else if (HAVE_AMD3DNOW && (mm_flags & AV_CPU_FLAG_3DNOW)) {
             c->prefetch = prefetch_3dnow;
 
             if (!high_bit_depth) {
@@ -2833,11 +2833,11 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
         }
 #endif
 
-        if(mm_flags & AV_CPU_FLAG_3DNOW){
+        if (HAVE_AMD3DNOW && (mm_flags & AV_CPU_FLAG_3DNOW)) {
             c->vorbis_inverse_coupling = vorbis_inverse_coupling_3dnow;
             c->vector_fmul = vector_fmul_3dnow;
         }
-        if(mm_flags & AV_CPU_FLAG_3DNOWEXT){
+        if (HAVE_AMD3DNOWEXT && (mm_flags & AV_CPU_FLAG_3DNOWEXT)) {
             c->vector_fmul_reverse = vector_fmul_reverse_3dnow2;
 #if HAVE_6REGS
             c->vector_fmul_window = vector_fmul_window_3dnow2;
@@ -2868,7 +2868,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
             c->scalarproduct_float = ff_scalarproduct_float_sse;
 #endif
         }
-        if(mm_flags & AV_CPU_FLAG_3DNOW)
+        if (HAVE_AMD3DNOW && (mm_flags & AV_CPU_FLAG_3DNOW))
             c->vector_fmul_add = vector_fmul_add_3dnow; // faster than sse
         if(mm_flags & AV_CPU_FLAG_SSE2){
 #if HAVE_YASM

From cc73511e8e81b2e1454f406acb71da9fd1c60d32 Mon Sep 17 00:00:00 2001
From: Dave Yeo <dave.r.yeo@gmail.com>
Date: Sun, 14 Aug 2011 11:46:18 -0700
Subject: [PATCH 10/10] Fix NASM include directive

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
---
 Makefile                                | 2 +-
 libavcodec/x86/ac3dsp.asm               | 4 ++--
 libavcodec/x86/dct32_sse.asm            | 4 ++--
 libavcodec/x86/deinterlace.asm          | 4 ++--
 libavcodec/x86/dsputil_yasm.asm         | 2 +-
 libavcodec/x86/dsputilenc_yasm.asm      | 4 ++--
 libavcodec/x86/fft_mmx.asm              | 2 +-
 libavcodec/x86/fmtconvert.asm           | 4 ++--
 libavcodec/x86/h264_chromamc.asm        | 4 ++--
 libavcodec/x86/h264_chromamc_10bit.asm  | 4 ++--
 libavcodec/x86/h264_deblock.asm         | 4 ++--
 libavcodec/x86/h264_deblock_10bit.asm   | 4 ++--
 libavcodec/x86/h264_idct.asm            | 4 ++--
 libavcodec/x86/h264_idct_10bit.asm      | 4 ++--
 libavcodec/x86/h264_intrapred.asm       | 4 ++--
 libavcodec/x86/h264_intrapred_10bit.asm | 4 ++--
 libavcodec/x86/h264_qpel_10bit.asm      | 4 ++--
 libavcodec/x86/h264_weight.asm          | 2 +-
 libavcodec/x86/h264_weight_10bit.asm    | 4 ++--
 libavcodec/x86/vc1dsp_yasm.asm          | 4 ++--
 libavcodec/x86/vp3dsp.asm               | 4 ++--
 libavcodec/x86/vp56dsp.asm              | 4 ++--
 libavcodec/x86/vp8dsp.asm               | 4 ++--
 23 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/Makefile b/Makefile
index 21639ca263..28ca055aad 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ IFLAGS     := -I. -I$(SRC_PATH)
 CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
 CFLAGS     += $(ECFLAGS)
 CCFLAGS     = $(CFLAGS)
-YASMFLAGS  += $(IFLAGS) -Pconfig.asm
+YASMFLAGS  += $(IFLAGS) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
 HOSTCFLAGS += $(IFLAGS)
 LDFLAGS    := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
 
diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index 9e92678afe..c1b0906a85 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -19,8 +19,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm
index f3eaf3a956..720a061078 100644
--- a/libavcodec/x86/dct32_sse.asm
+++ b/libavcodec/x86/dct32_sse.asm
@@ -19,8 +19,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA 32
 
diff --git a/libavcodec/x86/deinterlace.asm b/libavcodec/x86/deinterlace.asm
index 9150f4578e..8613485d5d 100644
--- a/libavcodec/x86/deinterlace.asm
+++ b/libavcodec/x86/deinterlace.asm
@@ -20,8 +20,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm
index c75bd5c0f4..4e1ec24a7a 100644
--- a/libavcodec/x86/dsputil_yasm.asm
+++ b/libavcodec/x86/dsputil_yasm.asm
@@ -19,7 +19,7 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
+%include "x86inc.asm"
 
 SECTION_RODATA
 pb_f: times 16 db 15
diff --git a/libavcodec/x86/dsputilenc_yasm.asm b/libavcodec/x86/dsputilenc_yasm.asm
index a0531b0b7e..6063ff1040 100644
--- a/libavcodec/x86/dsputilenc_yasm.asm
+++ b/libavcodec/x86/dsputilenc_yasm.asm
@@ -21,8 +21,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;*****************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION .text
 
diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
index 2177a6ba7a..27276a1a31 100644
--- a/libavcodec/x86/fft_mmx.asm
+++ b/libavcodec/x86/fft_mmx.asm
@@ -28,7 +28,7 @@
 ; in blocks as conventient to the vector size.
 ; i.e. {4x real, 4x imaginary, 4x real, ...} (or 2x respectively)
 
-%include "libavutil/x86/x86inc.asm"
+%include "x86inc.asm"
 
 %ifdef ARCH_X86_64
 %define pointer resq
diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm
index e384e8f0b2..efab87d570 100644
--- a/libavcodec/x86/fmtconvert.asm
+++ b/libavcodec/x86/fmtconvert.asm
@@ -19,8 +19,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_TEXT
 
diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm
index caef7dd7be..16cf2ec43e 100644
--- a/libavcodec/x86/h264_chromamc.asm
+++ b/libavcodec/x86/h264_chromamc.asm
@@ -20,8 +20,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm
index 56c0511857..9d075434fe 100644
--- a/libavcodec/x86/h264_chromamc_10bit.asm
+++ b/libavcodec/x86/h264_chromamc_10bit.asm
@@ -22,8 +22,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 1304e40261..92f91acade 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -24,8 +24,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION .text
 
diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm
index 0a1809c188..baac725eec 100644
--- a/libavcodec/x86/h264_deblock_10bit.asm
+++ b/libavcodec/x86/h264_deblock_10bit.asm
@@ -24,8 +24,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
index 42c175a0d8..37c2c90476 100644
--- a/libavcodec/x86/h264_idct.asm
+++ b/libavcodec/x86/h264_idct.asm
@@ -26,8 +26,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;*****************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm
index a9c12da5a2..54636a95d0 100644
--- a/libavcodec/x86/h264_idct_10bit.asm
+++ b/libavcodec/x86/h264_idct_10bit.asm
@@ -22,8 +22,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm
index 71b5aa130c..c1cd5c4d25 100644
--- a/libavcodec/x86/h264_intrapred.asm
+++ b/libavcodec/x86/h264_intrapred.asm
@@ -22,8 +22,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm
index 5a06896afe..e14e31a38c 100644
--- a/libavcodec/x86/h264_intrapred_10bit.asm
+++ b/libavcodec/x86/h264_intrapred_10bit.asm
@@ -22,8 +22,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA
 
diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm
index 30d0913cd1..15dd72ca36 100644
--- a/libavcodec/x86/h264_qpel_10bit.asm
+++ b/libavcodec/x86/h264_qpel_10bit.asm
@@ -22,8 +22,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA 32
 
diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm
index 9502462de2..d80ca32583 100644
--- a/libavcodec/x86/h264_weight.asm
+++ b/libavcodec/x86/h264_weight.asm
@@ -21,7 +21,7 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
+%include "x86inc.asm"
 
 SECTION .text
 
diff --git a/libavcodec/x86/h264_weight_10bit.asm b/libavcodec/x86/h264_weight_10bit.asm
index affc4ce5c4..1c58d72d94 100644
--- a/libavcodec/x86/h264_weight_10bit.asm
+++ b/libavcodec/x86/h264_weight_10bit.asm
@@ -22,8 +22,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA 32
 
diff --git a/libavcodec/x86/vc1dsp_yasm.asm b/libavcodec/x86/vc1dsp_yasm.asm
index bc53239e9d..220cc03da3 100644
--- a/libavcodec/x86/vc1dsp_yasm.asm
+++ b/libavcodec/x86/vc1dsp_yasm.asm
@@ -19,8 +19,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 cextern pw_4
 cextern pw_5
diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
index 096879bc47..23574383a1 100644
--- a/libavcodec/x86/vp3dsp.asm
+++ b/libavcodec/x86/vp3dsp.asm
@@ -19,8 +19,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 ; MMX-optimized functions cribbed from the original VP3 source code.
 
diff --git a/libavcodec/x86/vp56dsp.asm b/libavcodec/x86/vp56dsp.asm
index 5c77bea55a..c70ed60d76 100644
--- a/libavcodec/x86/vp56dsp.asm
+++ b/libavcodec/x86/vp56dsp.asm
@@ -20,8 +20,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 cextern pw_64
 
diff --git a/libavcodec/x86/vp8dsp.asm b/libavcodec/x86/vp8dsp.asm
index 1434be629e..7d9ebc9463 100644
--- a/libavcodec/x86/vp8dsp.asm
+++ b/libavcodec/x86/vp8dsp.asm
@@ -20,8 +20,8 @@
 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 ;******************************************************************************
 
-%include "libavutil/x86/x86inc.asm"
-%include "libavutil/x86/x86util.asm"
+%include "x86inc.asm"
+%include "x86util.asm"
 
 SECTION_RODATA