On 05/17/2013 12:42 PM, Kostya Shishkov wrote:
> On Fri, May 17, 2013 at 12:36:29PM +0200, Luca Barbato wrote:
>> 3 is not exactly descriptive.
>> ---
>>  libavcodec/jpegls.h    | 4 +++-
>>  libavcodec/jpeglsdec.c | 2 +-
>>  2 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/jpegls.h b/libavcodec/jpegls.h
>> index 4bf9562..1ab15ee 100644
>> --- a/libavcodec/jpegls.h
>> +++ b/libavcodec/jpegls.h
>> @@ -36,12 +36,14 @@ typedef struct JpeglsContext {
>>      AVFrame picture;
>>  } JpeglsContext;
>>  
>> +#define COMPONENTS 3
>> +
>>  typedef struct JLSState {
>>      int T1, T2, T3;
>>      int A[367], B[367], C[365], N[367];
>>      int limit, reset, bpp, qbpp, maxval, range;
>>      int near, twonear;
>> -    int run_index[3];
>> +    int run_index[COMPONENTS];
>>  } JLSState;
>>  
>>  extern const uint8_t ff_log2_run[32];
>> diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
>> index 6d884a4..d4ecf3d 100644
>> --- a/libavcodec/jpeglsdec.c
>> +++ b/libavcodec/jpeglsdec.c
>> @@ -332,7 +332,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int 
>> near,
>>          memset(cur, 0, s->picture_ptr->linesize[0]);
>>          width = s->width * 3;
>                               ^ why not here?
>>          for (i = 0; i < s->height; i++) {
>> -            for (j = 0; j < 3; j++) {
>> +            for (j = 0; j < COMPONENTS; j++) {
>>                  ls_decode_line(state, s, last + j, cur + j,
>>                                 Rc[j], width, 3, j, 8);
>                                                 ^ why not here?
>>                  Rc[j] = last[j];
>> -- 
> 
> magic numberS implies more than single number
> Also it should be clear enough without this change.
> That's why I consider this patch useless.

You are right =P, amending adding it there and there as well.

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

Reply via email to