[FFmpeg-devel] [PATCH] Added more tests to libswscale/utils.c

Petru Rares Sincraian psincraian at outlook.com
Wed Mar 30 12:12:29 CEST 2016


Hi,

I solved the problems with swscale_license() and alloc_gamma_tbl() functions. I am working to solve alphaless_fmt() function in a different way.

________________________________________
From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> on behalf of Michael Niedermayer <michael at niedermayer.cc>
Sent: Sunday, March 27, 2016 9:43 PM
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] [PATCH] Added more tests to libswscale/utils.c

On Sun, Mar 27, 2016 at 04:39:39PM +0000, Petru Rares Sincraian wrote:
>
>       - Added test for: swscale_license()
>       - Added test for: alphaless_fmt()
>       - Added test for: alloc_gamma_tbl()
[...]

> +static void test_alloc_gamma_tbl(void)
> +{
> +    uint16_t *tbl = alloc_gamma_tbl(1.);
> +    int i;
> +
> +    // print only 32 elements
> +    printf("e = 1.0\n");
> +    for (i = 0; i < 65536; i += 2048)
> +        printf("it: %d\t value: %d\n", i, tbl[i]);
> +
> +    tbl = alloc_gamma_tbl(0.75);
> +    printf("\ne = 0.75\n");
> +    for (i = 0; i < 65536; i += 2048)
> +        printf("it: %d\t value: %d\n", i, tbl[i]);
> +
> +    tbl = alloc_gamma_tbl(2.8);
> +    printf("\ne = 2.8\n");
> +    for (i = 0; i < 65536; i += 2048)
> +        printf("it: %d\t value: %d\n", i, tbl[i]);

this leaks memory

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-more-tests-to-libswscale-utils.c.patch
Type: text/x-patch
Size: 5987 bytes
Desc: 0001-Added-more-tests-to-libswscale-utils.c.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160330/61f89df5/attachment.bin>


More information about the ffmpeg-devel mailing list