[FFmpeg-devel] [PATCH 5/5] avfilter/drawutils: support native-endian instead of little endian

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Jan 27 18:44:52 EET 2019


2019-01-27 17:38 GMT+01:00, Muhammad Faiz <mfcc64 at gmail.com>:
> On Sun, Jan 27, 2019 at 11:02 PM Carl Eugen Hoyos <ceffmpeg at gmail.com>
> wrote:
>>
>> 2019-01-27 16:18 GMT+01:00, Muhammad Faiz <mfcc64 at gmail.com>:
>> > On Sun, Jan 27, 2019 at 5:25 PM Marton Balint <cus at passwd.hu> wrote:
>> >>
>> >> On Sun, 27 Jan 2019, Muhammad Faiz wrote:

>> >> > +static int is_native_endian(const AVPixFmtDescriptor *desc)
>> >> > +{
>> >> > +    int len = strlen(desc->name);
>> >> > +
>> >> > +    if (!strcmp(desc->name + len - 2, "be"))
>> >> > +        return HAVE_BIGENDIAN;
>> >> > +    if (!strcmp(desc->name + len - 2, "le"))
>> >> > +        return !HAVE_BIGENDIAN;
>> >> > +    return 1;
>> >> > +}
>> >> > +
>> >>
>> >> Maybe you can check if shift+depth > 8 and FMT_FLAG_BE
>> >> instead of string compare?
>> >
>> > I don't really understand your code.
>>
>> Something like "return shift + depth <=8 ||
>> desc->flags | FMT_FLAG_BE ^ !HAVE_BIGENDIAN"
>
> OK, I will try.

Please use Marton's suggestion, the "|" will not be the only
thing completely wrong.

Carl Eugen


More information about the ffmpeg-devel mailing list