Remove some of the dependancies of lavfi on lavc. Originally committed as revision 21575 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | /* #define DEBUG */ | 22 | /* #define DEBUG */ |
| 23 | 23 | ||
| 24 | #include "libavcodec/imgconvert.h" | 24 | #include "libavcodec/imgconvert.h" |
| 25 | #include "libavutil/pixdesc.h" | ||
| 25 | #include "avfilter.h" | 26 | #include "avfilter.h" |
| 26 | 27 | ||
| 27 | unsigned avfilter_version(void) { | 28 | unsigned avfilter_version(void) { |
| @@ -183,7 +184,7 @@ static void dprintf_link(void *ctx, AVFilterLink *link, int end) · 155 unmodified lines | |||
| 183 | dprintf(ctx, | 184 | dprintf(ctx, |
| 184 | "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s", | 185 | "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s", |
| 185 | link, link->w, link->h, | 186 | link, link->w, link->h, |
| 186 | avcodec_get_pix_fmt_name(link->format), | 187 | av_pix_fmt_descriptors[link->format].name, |
| 187 | link->src ? link->src->filter->name : "", | 188 | link->src ? link->src->filter->name : "", |
| 188 | link->dst ? link->dst->filter->name : "", | 189 | link->dst ? link->dst->filter->name : "", |
| 189 | end ? "\n" : ""); | 190 | end ? "\n" : ""); |
| @@ -298,7 +299,8 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 108 unmodified lines | |||
| 298 | 299 | ||
| 299 | /* copy the slice if needed for permission reasons */ | 300 | /* copy the slice if needed for permission reasons */ |
| 300 | if(link->srcpic) { | 301 | if(link->srcpic) { |
| 301 | avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub); | 302 | hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w; |
| 303 | vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; | ||
| 302 | 304 | ||
| 303 | for(i = 0; i < 4; i ++) { | 305 | for(i = 0; i < 4; i ++) { |
| 304 | if(link->srcpic->data[i]) { | 306 | if(link->srcpic->data[i]) { |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include "avfilter.h" | 26 | #include "avfilter.h" |
| 27 | #include "libavutil/pixdesc.h" | ||
| 27 | #include "libswscale/swscale.h" | 28 | #include "libswscale/swscale.h" |
| 28 | 29 | ||
| 29 | typedef struct { | 30 | typedef struct { |
| @@ -126,7 +127,7 @@ static int config_props(AVFilterLink *outlink) · 96 unmodified lines | |||
| 126 | SWS_BILINEAR, NULL, NULL, NULL); | 127 | SWS_BILINEAR, NULL, NULL, NULL); |
| 127 | 128 | ||
| 128 | av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n", | 129 | av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n", |
| 129 | outlink->w, outlink->h, avcodec_get_pix_fmt_name(outlink->format)); | 130 | outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name); |
| 130 | 131 | ||
| 131 | scale->input_is_pal = inlink->format == PIX_FMT_PAL8 || | 132 | scale->input_is_pal = inlink->format == PIX_FMT_PAL8 || |
| 132 | inlink->format == PIX_FMT_BGR4_BYTE || | 133 | inlink->format == PIX_FMT_BGR4_BYTE || |
| @@ -143,7 +144,8 @@ static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) · 10 unmodified lines | |||
| 143 | AVFilterLink *outlink = link->dst->outputs[0]; | 144 | AVFilterLink *outlink = link->dst->outputs[0]; |
| 144 | AVFilterPicRef *outpicref; | 145 | AVFilterPicRef *outpicref; |
| 145 | 146 | ||
| 146 | avcodec_get_chroma_sub_sample(link->format, &scale->hsub, &scale->vsub); | 147 | scale->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w; |
| 148 | scale->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; | ||
| 147 | 149 | ||
| 148 | outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); | 150 | outpicref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); |
| 149 | outpicref->pts = picref->pts; | 151 | outpicref->pts = picref->pts; |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include "avfilter.h" | 26 | #include "avfilter.h" |
| 27 | #include "libavutil/pixdesc.h" | ||
| 27 | 28 | ||
| 28 | typedef struct { | 29 | typedef struct { |
| 29 | int h; ///< output slice height | 30 | int h; ///< output slice height |
| @@ -44,9 +45,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 14 unmodified lines | |||
| 44 | static int config_props(AVFilterLink *link) | 45 | static int config_props(AVFilterLink *link) |
| 45 | { | 46 | { |
| 46 | SliceContext *slice = link->dst->priv; | 47 | SliceContext *slice = link->dst->priv; |
| 47 | int tmp; | ||
| 48 | 48 | ||
| 49 | avcodec_get_chroma_sub_sample(link->format, &tmp, &slice->vshift); | 49 | slice->vshift = av_pix_fmt_descriptors[link->format].log2_chroma_h; |
| 50 | 50 | ||
| 51 | /* ensure that slices play nice with chroma subsampling, and enforce | 51 | /* ensure that slices play nice with chroma subsampling, and enforce |
| 52 | * a reasonable minimum size for the slices */ | 52 | * a reasonable minimum size for the slices */ |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | * video vertical flip filter | 23 | * video vertical flip filter |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #include "libavutil/pixdesc.h" | ||
| 26 | #include "avfilter.h" | 27 | #include "avfilter.h" |
| 27 | 28 | ||
| 28 | typedef struct { | 29 | typedef struct { |
| @@ -32,9 +33,8 @@ typedef struct { · 3 unmodified lines | |||
| 32 | static int config_input(AVFilterLink *link) | 33 | static int config_input(AVFilterLink *link) |
| 33 | { | 34 | { |
| 34 | FlipContext *flip = link->dst->priv; | 35 | FlipContext *flip = link->dst->priv; |
| 35 | int tmp; | ||
| 36 | 36 | ||
| 37 | avcodec_get_chroma_sub_sample(link->format, &tmp, &flip->vsub); | 37 | flip->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h; |
| 38 | 38 | ||
| 39 | return 0; | 39 | return 0; |
| 40 | } | 40 | } |