On Tue, 9 Apr 2019 at 14:43, NDJORE BORIS <[email protected]> wrote:

>
> Thank you simon.
>
> You probably right. The first loop is to obten all macroblock in the frame
> and the second is to optain each pixel in the macroblock, I thinked.
> But in what you gave if I do this for two different block, I think that I
> will obtain the same value for "y".
> Can you explain me  how can I do to obtain different "y" value for each
> macroblock if I'm wrong , please?
>
> Regards
>
>>
>> So the first loop needs to be:
for (int mby=0 ; mby< mb_height ; mby++) {

and similarly for mbx.
Then you can declare outside of the loop an array for yval, uval and vval
(I notice now that you also use variable y for the y pixel value, rather
than just the inner loop counter!):
uint16_t yval[mb_height * mb_width][256];
and then set:
yval[mby*mb_width + mbx][y*16+x] = data[0][.....];
etc.
Then yval[0] would have an array of 256 values for Y for the first
macroblock, and yval[1] would have 256 values for Y for the second
macroblock.
If you want an average Y, U and V value then you can always sum inside the
loop and divide by 256, and then just store one value for yval[0] rather
than 256.

Regards,
Simon
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to