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

Chris Kennedy chris at crunchyroll.com
Sat Oct 26 14:44:58 EEST 2019


On Sat, Oct 26, 2019 at 4:15 AM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>
> 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?

Oops sorry, I meant to remove YUV420P and will submit a new patch.
Thank you for helping me understand this part more clearly. I think I
get it and removing YUV420P should make this clear for the code
too.



>
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



-- 
---
Christopher Kennedy


More information about the ffmpeg-devel mailing list