Paul B Mahol <one...@gmail.com> writes:

> On 1/10/12, Maans Rullgaard <m...@mansr.com> wrote:
>> Paul B Mahol <one...@gmail.com> writes:
>>
>>> ---
>>>  libswscale/rgb2rgb.c          |   13 +++++++++++++
>>>  libswscale/rgb2rgb.h          |    1 +
>>>  libswscale/swscale_unscaled.c |    1 +
>>>  3 files changed, 15 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
>>> index 0f07e57..4d54ac5 100644
>>> --- a/libswscale/rgb2rgb.c
>>> +++ b/libswscale/rgb2rgb.c
>>> @@ -282,6 +282,19 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst,
>>> int src_size)
>>>      }
>>>  }
>>>
>>> +void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
>>> +{
>>> +    int i;
>>> +    int num_pixels = src_size >> 1;
>>> +
>>> +    for (i = 0; i < num_pixels; i++) {
>>> +        unsigned br;
>>> +        unsigned rgb = ((const uint16_t *)src)[i];
>>> +        br = rgb & 0x0F0F;
>>> +        ((uint16_t *)dst)[i] = (br >> 8) | (rgb & 0x00F0) | (br << 8);
>>> +    }
>>> +}
>>
>> Why so complicated?
>>
>> I also don't like the look of those pointer casts.
>
> I don't follow.

Can someone explain in more convoluted terms what I mean?  Perhaps then
there will be something to "follow" for those who like things complicated.

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to