{
if (codec && codec->pix_fmts) {
const enum AVPixelFormat *p = codec->pix_fmts;
- int has_alpha= av_pix_fmt_descriptors[target].nb_components % 2 == 0;
+ int has_alpha= av_pix_fmt_desc_get(target)->nb_components % 2 == 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
if (target != AV_PIX_FMT_NONE)
av_log(NULL, AV_LOG_WARNING,
"Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
- av_pix_fmt_descriptors[target].name,
+ av_get_pix_fmt_name(target),
codec->name,
- av_pix_fmt_descriptors[best].name);
+ av_get_pix_fmt_name(best));
return best;
}
}
{
AVCodecContext *avctx = (AVCodecContext*)arg;
StagefrightContext *s = (StagefrightContext*)avctx->priv_data;
- const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[avctx->pix_fmt];
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(avctx->pix_fmt);
Frame* frame;
MediaBuffer *buffer;
int32_t w, h;
if (link->type == AVMEDIA_TYPE_VIDEO) {
if(ref && ref->type == AVMEDIA_TYPE_VIDEO){
- int has_alpha= av_pix_fmt_descriptors[ref->format].nb_components % 2 == 0;
+ int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
int i;
for (i=0; i<link->in_formats->format_count; i++) {
{
AVFilterContext *ctx = inlink->dst;
ColorMatrixContext *color = ctx->priv;
- const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format];
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
color->hsub = pix_desc->log2_chroma_w;
color->vsub = pix_desc->log2_chroma_h;
{
AVFilterContext *ctx = inlink->dst;
DecimateContext *decimate = ctx->priv;
- const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format];
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
decimate->hsub = pix_desc->log2_chroma_w;
decimate->vsub = pix_desc->log2_chroma_h;
#include "transform.h"
-#define CHROMA_WIDTH(link) -((-link->w) >> av_pix_fmt_descriptors[link->format].log2_chroma_w)
-#define CHROMA_HEIGHT(link) -((-link->h) >> av_pix_fmt_descriptors[link->format].log2_chroma_h)
+#define CHROMA_WIDTH(link) -((-link->w) >> av_pix_fmt_desc_get(link->format)->log2_chroma_w)
+#define CHROMA_HEIGHT(link) -((-link->h) >> av_pix_fmt_desc_get(link->format)->log2_chroma_h)
enum SearchMethod {
EXHAUSTIVE, ///< Search all possible positions
avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
/* copy palette if required */
- if (av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL)
+ if (av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_PAL)
memcpy(inlink->dst->outputs[0]->out_buf->data[1], picref->data[1], AVPALETTE_SIZE);
return ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
static int config_props(AVFilterLink *inlink)
{
HueContext *hue = inlink->dst->priv;
- const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[inlink->format];
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
hue->hsub = desc->log2_chroma_w;
hue->vsub = desc->log2_chroma_h;
return 0;
if (!idet->csp)
- idet->csp = &av_pix_fmt_descriptors[link->format];
+ idet->csp = av_pix_fmt_desc_get(link->format);
if (idet->csp->comp[0].depth_minus1 / 8 == 1)
idet->filter_line = (void*)filter_line_c_16bit;
char *expr;
double var_values[VAR_VARS_NB], res;
int ret;
- const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[inlink->format];
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format);
av_image_fill_max_pixsteps(over->overlay_pix_step, NULL, pix_desc);
static int config_props(AVFilterLink *inlink)
{
SmartblurContext *sblur = inlink->dst->priv;
- const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[inlink->format];
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
sblur->hsub = desc->log2_chroma_w;
sblur->vsub = desc->log2_chroma_h;
{
AVFilterContext *ctx = outlink->src;
AVFilterLink *inlink = outlink->src->inputs[0];
- const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[outlink->format];
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
TInterlaceContext *tinterlace = ctx->priv;
tinterlace->vsub = desc->log2_chroma_h;
enum AVPixelFormat format, int w, int src_h,
int src_field, int interleave, int dst_field)
{
- const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[format];
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
int plane, vsub = desc->log2_chroma_h;
int k = src_field == FIELD_UPPER_AND_LOWER ? 1 : 2;
avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf);
/* copy palette if required */
- if (av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL)
+ if (av_pix_fmt_desc_get(link->format)->flags & PIX_FMT_PAL)
memcpy(link->cur_buf->data[1], link->src_buf-> data[1], AVPALETTE_SIZE);
}
else
{
AVFilterContext *ctx = outlink->src;
MPTestContext *test = ctx->priv;
- const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[outlink->format];
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(outlink->format);
test->hsub = pix_desc->log2_chroma_w;
test->vsub = pix_desc->log2_chroma_h;
#if 0 // FIXME
#define isGray(x) \
- (!(av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) && \
- av_pix_fmt_descriptors[x].nb_components <= 2)
+ (!(av_pix_fmt_desc_get(x)->flags & PIX_FMT_PAL) && \
+ av_pix_fmt_desc_get(x)->nb_components <= 2)
#else
#define isGray(x) \
((x) == AV_PIX_FMT_GRAY8 || \
} else if (c->srcBpc == 12) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
ff_hscale12to19_ ## filtersize ## _ ## opt1; \
- } 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)) { \
+ } 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)) { \
hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
ff_hscale14to19_ ## filtersize ## _ ## opt1; \
} else { /* c->srcBpc == 16 */ \
if (list_pix_fmt_fourccs) {
for (i = 0; i < AV_PIX_FMT_NB; i++) {
- const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[i];
+ const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(i);
if (!pix_desc->name || pix_desc->flags & PIX_FMT_HWACCEL)
continue;
printf("%s: ", pix_desc->name);