[FFmpeg-devel] [PATCH] add phqm filter and img_hash

Carl Eugen Hoyos ceffmpeg at gmail.com
Sat Oct 26 12:14:44 EEST 2019


Am Sa., 26. Okt. 2019 um 06:45 Uhr schrieb <ckennedy at ellation.com>:

> +// convert from avframe to iplimage format
> +static int fill_iplimage_from_frame(IplImage *img, const AVFrame *frame, enum AVPixelFormat pixfmt)
> +{
> +    IplImage *tmpimg;
> +    int depth = IPL_DEPTH_8U, channels_nb;
> +
> +    switch (pixfmt) {
> +        case AV_PIX_FMT_GRAY8:      channels_nb = 1; break;
> +        case AV_PIX_FMT_BGRA:       channels_nb = 4; break;
> +        case AV_PIX_FMT_BGR24:      channels_nb = 3; break;
> +        case AV_PIX_FMT_YUV420P:    channels_nb = 3; break;
> +        default: return -1;
> +    }
> +
> +    tmpimg = cvCreateImageHeader((CvSize){frame->width, frame->height}, depth, channels_nb);

Let me rephrase:
Assuming the layouts of BGR24 and YUV420P are not identical (they are not), how
is cvCreateImageHeader() or the following functions supposed to know
that they are
not the same?

Carl Eugen


More information about the ffmpeg-devel mailing list