On 02/15/2012 10:29 AM, Justin Ruggles wrote:

> On 02/15/2012 05:12 AM, Kostya Shishkov wrote:
> 
>> On Wed, Feb 15, 2012 at 02:06:01AM -0800, Mashiat Sarker Shakkhar wrote:
>>> ----- Original Message -----
>>>
>>>> From: Aneesh Dogra <[email protected]>
>>>> To: [email protected]
>>>> Cc: 
>>>> Sent: Wednesday, February 15, 2012 2:54 AM
>>>> Subject: [libav-devel] [PATCH] Sun Rasterfile Encoder
>>>>
>>>> ---
>>>> Changelog               |    1 +
>>>> libavcodec/Makefile     |    1 +
>>>> libavcodec/allcodecs.c  |    2 +-
>>>> libavcodec/sunrastenc.c |  246 
>>>> +++++++++++++++++++++++++++++++++++++++++++++++
>>>> libavformat/img2.c      |    3 +-
>>>> 5 files changed, 251 insertions(+), 2 deletions(-)
>>> [...]
>>>> +    switch (avctx->pix_fmt) {
>>>> +        case PIX_FMT_MONOWHITE:                  // Monochrome
>>>> +            s->depth  = 1;
>>>> +            s->length = ((avctx->width + 7) >> 3) * avctx->height +
>>>> +                        (((avctx->width / 8) + (avctx->width % 8 ? 1 : 
>>>> 0)) % 2 ?
>>>> +                         avctx->height : 0);
>>>
>>>
>>> Nit: I propose
>>> s->length = ((width + 7 >> 3) + 1 >> 1) * height * 2;
>>
>> nit: which can be simplified to ((width + 15) >> 4) * height;
> 
> 
> But that's not quite right as far as the actual size. I think this is
> though:
> 
> (FFALIGN(width, 16) >> 3) * height
> 
> Even the comments in the decoder say "width is aligned to 16 bits".


sorry, i was paraphrasing. it really says "scanlines are aligned on 16
bit boundaries". my suggestion should work for doing that.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to