Hi,

On Mon, Dec 17, 2012 at 10:55 PM, Janne Grunau <[email protected]> wrote:
> On 2012-12-17 18:24:37 -0800, Ronald S. Bultje wrote:
>> Hi,
>> On Dec 17, 2012 1:02 PM, "Janne Grunau" <[email protected]> wrote:
>> >
>> > Compute dist_scale_factor_field only for MBAFF since that is the only
>> > case in which it is used.
>>
>> The patch also increases an array size - why?
>
> to handle up to 32 references for field pictures. Alternatively both
> arrays can probably be merged to the usual 16 + 32 size.

Check the code:
+            for (i = 0; i < 2 * h->ref_count[0]; i++)
+                h->dist_scale_factor_field[field][i^field] =
+                    get_scale_factor(h, poc, poc1, i+16);
+        }
+
+    for (i = 0; i < h->ref_count[0]; i++){
         h->dist_scale_factor[i] = get_scale_factor(h, poc, poc1, i);
     }

For arrays of size:

-    int dist_scale_factor[16];
+    int dist_scale_factor[32];
     int dist_scale_factor_field[2][32];

If i for setting dist_scale_factor_field is [0, ref_count * 2] and
that's [0, 32], them ref_count is 16, thus the second loop i [0,
ref_count] is [0, 16], thus dist_scale_factor[] only needs to be of
size 16.

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

Reply via email to