Unified · Split
| @@ -37,7 +37,7 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo · 36 unmodified lines | ||
| 37 | 37 | { |
| 38 | 38 | if (codec && codec->pix_fmts) { |
| 39 | 39 | const enum AVPixelFormat *p = codec->pix_fmts; |
| 40 | − int has_alpha= av_pix_fmt_descriptors[target].nb_components % 2 == 0; | |
| 40 | + int has_alpha= av_pix_fmt_desc_get(target)->nb_components % 2 == 0; | |
| 41 | 41 | enum AVPixelFormat best= AV_PIX_FMT_NONE; |
| 42 | 42 | if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) { |
| 43 | 43 | if (st->codec->codec_id == AV_CODEC_ID_MJPEG) { |
| @@ -56,9 +56,9 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo · 12 unmodified lines | ||
| 56 | 56 | if (target != AV_PIX_FMT_NONE) |
| 57 | 57 | av_log(NULL, AV_LOG_WARNING, |
| 58 | 58 | "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n", |
| 59 | − av_pix_fmt_descriptors[target].name, | |
| 59 | + av_get_pix_fmt_name(target), | |
| 60 | 60 | codec->name, |
| 61 | − av_pix_fmt_descriptors[best].name); | |
| 61 | + av_get_pix_fmt_name(best)); | |
| 62 | 62 | return best; |
| 63 | 63 | } |
| 64 | 64 | } |
| @@ -153,7 +153,7 @@ void* decode_thread(void *arg) · 152 unmodified lines | ||
| 153 | 153 | { |
| 154 | 154 | AVCodecContext *avctx = (AVCodecContext*)arg; |
| 155 | 155 | StagefrightContext *s = (StagefrightContext*)avctx->priv_data; |
| 156 | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[avctx->pix_fmt]; | |
| 156 | + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt); | |
| 157 | 157 | Frame* frame; |
| 158 | 158 | MediaBuffer *buffer; |
| 159 | 159 | int32_t w, h; |
| @@ -424,7 +424,7 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 423 unmodified lines | ||
| 424 | 424 | |
| 425 | 425 | if (link->type == AVMEDIA_TYPE_VIDEO) { |
| 426 | 426 | if(ref && ref->type == AVMEDIA_TYPE_VIDEO){ |
| 427 | − int has_alpha= av_pix_fmt_descriptors[ref->format].nb_components % 2 == 0; | |
| 427 | + int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0; | |
| 428 | 428 | enum AVPixelFormat best= AV_PIX_FMT_NONE; |
| 429 | 429 | int i; |
| 430 | 430 | for (i=0; i<link->in_formats->format_count; i++) { |
| @@ -308,7 +308,7 @@ static int config_input(AVFilterLink *inlink) · 307 unmodified lines | ||
| 308 | 308 | { |
| 309 | 309 | AVFilterContext *ctx = inlink->dst; |
| 310 | 310 | ColorMatrixContext *color = ctx->priv; |
| 311 | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; | |
| 311 | + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); | |
| 312 | 312 | |
| 313 | 313 | color->hsub = pix_desc->log2_chroma_w; |
| 314 | 314 | color->vsub = pix_desc->log2_chroma_h; |
| @@ -180,7 +180,7 @@ static int config_input(AVFilterLink *inlink) · 179 unmodified lines | ||
| 180 | 180 | { |
| 181 | 181 | AVFilterContext *ctx = inlink->dst; |
| 182 | 182 | DecimateContext *decimate = ctx->priv; |
| 183 | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; | |
| 183 | + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); | |
| 184 | 184 | decimate->hsub = pix_desc->log2_chroma_w; |
| 185 | 185 | decimate->vsub = pix_desc->log2_chroma_h; |
| 186 | 186 | |
| @@ -59,8 +59,8 @@ · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | #include "transform.h" |
| 61 | 61 | |
| 62 | −#define CHROMA_WIDTH(link) -((-link->w) >> av_pix_fmt_descriptors[link->format].log2_chroma_w) | |
| 63 | −#define CHROMA_HEIGHT(link) -((-link->h) >> av_pix_fmt_descriptors[link->format].log2_chroma_h) | |
| 62 | +#define CHROMA_WIDTH(link) -((-link->w) >> av_pix_fmt_desc_get(link->format)->log2_chroma_w) | |
| 63 | +#define CHROMA_HEIGHT(link) -((-link->h) >> av_pix_fmt_desc_get(link->format)->log2_chroma_h) | |
| 64 | 64 | |
| 65 | 65 | enum SearchMethod { |
| 66 | 66 | EXHAUSTIVE, ///< Search all possible positions |
| @@ -95,7 +95,7 @@ static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 94 unmodified lines | ||
| 95 | 95 | avfilter_copy_buffer_ref_props(outlink->out_buf, picref); |
| 96 | 96 | |
| 97 | 97 | /* copy palette if required */ |
| 98 | − if (av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL) | |
| 98 | + if (av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_PAL) | |
| 99 | 99 | memcpy(inlink->dst->outputs[0]->out_buf->data[1], picref->data[1], AVPALETTE_SIZE); |
| 100 | 100 | |
| 101 | 101 | return ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0)); |
| @@ -252,7 +252,7 @@ static int query_formats(AVFilterContext *ctx) · 251 unmodified lines | ||
| 252 | 252 | static int config_props(AVFilterLink *inlink) |
| 253 | 253 | { |
| 254 | 254 | HueContext *hue = inlink->dst->priv; |
| 255 | − const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[inlink->format]; | |
| 255 | + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); | |
| 256 | 256 | |
| 257 | 257 | hue->hsub = desc->log2_chroma_w; |
| 258 | 258 | hue->vsub = desc->log2_chroma_h; |
| @@ -195,7 +195,7 @@ static int end_frame(AVFilterLink *link) · 194 unmodified lines | ||
| 195 | 195 | return 0; |
| 196 | 196 | |
| 197 | 197 | if (!idet->csp) |
| 198 | − idet->csp = &av_pix_fmt_descriptors[link->format]; | |
| 198 | + idet->csp = av_pix_fmt_desc_get(link->format); | |
| 199 | 199 | if (idet->csp->comp[0].depth_minus1 / 8 == 1) |
| 200 | 200 | idet->filter_line = (void*)filter_line_c_16bit; |
| 201 | 201 | |
| @@ -217,7 +217,7 @@ static int config_input_overlay(AVFilterLink *inlink) · 216 unmodified lines | ||
| 217 | 217 | char *expr; |
| 218 | 218 | double var_values[VAR_VARS_NB], res; |
| 219 | 219 | int ret; |
| 220 | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format]; | |
| 220 | + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); | |
| 221 | 221 | |
| 222 | 222 | av_image_fill_max_pixsteps(over->overlay_pix_step, NULL, pix_desc); |
| 223 | 223 | |
| @@ -169,7 +169,7 @@ static int alloc_sws_context(FilterParam *f, int width, int height, unsigned int · 168 unmodified lines | ||
| 169 | 169 | static int config_props(AVFilterLink *inlink) |
| 170 | 170 | { |
| 171 | 171 | SmartblurContext *sblur = inlink->dst->priv; |
| 172 | − const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[inlink->format]; | |
| 172 | + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); | |
| 173 | 173 | |
| 174 | 174 | sblur->hsub = desc->log2_chroma_w; |
| 175 | 175 | sblur->vsub = desc->log2_chroma_h; |
| @@ -130,7 +130,7 @@ static int config_out_props(AVFilterLink *outlink) · 129 unmodified lines | ||
| 130 | 130 | { |
| 131 | 131 | AVFilterContext *ctx = outlink->src; |
| 132 | 132 | AVFilterLink *inlink = outlink->src->inputs[0]; |
| 133 | − const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[outlink->format]; | |
| 133 | + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format); | |
| 134 | 134 | TInterlaceContext *tinterlace = ctx->priv; |
| 135 | 135 | |
| 136 | 136 | tinterlace->vsub = desc->log2_chroma_h; |
| @@ -179,7 +179,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], · 42 unmodified lines | ||
| 179 | 179 | enum AVPixelFormat format, int w, int src_h, |
| 180 | 180 | int src_field, int interleave, int dst_field) |
| 181 | 181 | { |
| 182 | − const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[format]; | |
| 182 | + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); | |
| 183 | 183 | int plane, vsub = desc->log2_chroma_h; |
| 184 | 184 | int k = src_field == FIELD_UPPER_AND_LOWER ? 1 : 2; |
| 185 | 185 | |
| @@ -286,7 +286,7 @@ int ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 285 unmodified lines | ||
| 286 | 286 | avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf); |
| 287 | 287 | |
| 288 | 288 | /* copy palette if required */ |
| 289 | − if (av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL) | |
| 289 | + if (av_pix_fmt_desc_get(link->format)->flags & PIX_FMT_PAL) | |
| 290 | 290 | memcpy(link->cur_buf->data[1], link->src_buf-> data[1], AVPALETTE_SIZE); |
| 291 | 291 | } |
| 292 | 292 | else |
| @@ -298,7 +298,7 @@ static int config_props(AVFilterLink *outlink) · 297 unmodified lines | ||
| 298 | 298 | { |
| 299 | 299 | AVFilterContext *ctx = outlink->src; |
| 300 | 300 | MPTestContext *test = ctx->priv; |
| 301 | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[outlink->format]; | |
| 301 | + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(outlink->format); | |
| 302 | 302 | |
| 303 | 303 | test->hsub = pix_desc->log2_chroma_w; |
| 304 | 304 | test->vsub = pix_desc->log2_chroma_h; |
| @@ -602,8 +602,8 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt) · 601 unmodified lines | ||
| 602 | 602 | |
| 603 | 603 | #if 0 // FIXME |
| 604 | 604 | #define isGray(x) \ |
| 605 | − (!(av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) && \ | |
| 606 | − av_pix_fmt_descriptors[x].nb_components <= 2) | |
| 605 | + (!(av_pix_fmt_desc_get(x)->flags & PIX_FMT_PAL) && \ | |
| 606 | + av_pix_fmt_desc_get(x)->nb_components <= 2) | |
| 607 | 607 | #else |
| 608 | 608 | #define isGray(x) \ |
| 609 | 609 | ((x) == AV_PIX_FMT_GRAY8 || \ |
| @@ -402,7 +402,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c) · 401 unmodified lines | ||
| 402 | 402 | } else if (c->srcBpc == 12) { \ |
| 403 | 403 | hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \ |
| 404 | 404 | ff_hscale12to19_ ## filtersize ## _ ## opt1; \ |
| 405 | − } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)) { \ | |
| 405 | + } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth_minus1<15)) { \ | |
| 406 | 406 | hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \ |
| 407 | 407 | ff_hscale14to19_ ## filtersize ## _ ## opt1; \ |
| 408 | 408 | } else { /* c->srcBpc == 16 */ \ |
| @@ -98,7 +98,7 @@ int main(int argc, char **argv) · 97 unmodified lines | ||
| 98 | 98 | |
| 99 | 99 | if (list_pix_fmt_fourccs) { |
| 100 | 100 | for (i = 0; i < AV_PIX_FMT_NB; i++) { |
| 101 | − const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[i]; | |
| 101 | + const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(i); | |
| 102 | 102 | if (!pix_desc->name || pix_desc->flags & PIX_FMT_HWACCEL) |
| 103 | 103 | continue; |
| 104 | 104 | printf("%s: ", pix_desc->name); |