On Thu, Apr 09, 2015 at 06:09:33PM +0200, Vittorio Giovara wrote:
> In preparation for multithread decoding.
multithread_ed
> --- a/libavcodec/hqx.c
> +++ b/libavcodec/hqx.c
> @@ -154,9 +151,9 @@ static int decode_block(GetBitContext *gb, VLC *vlc,
> -static int hqx_decode_422(HQXContext *ctx, AVFrame *pic,
> - GetBitContext *gb, int x, int y)
> +static int hqx_decode_422(void *c, GetBitContext *gb, int x, int y)
> {
> + HQXContext *ctx = (HQXContext *)c;
pointless void* cast
> @@ -179,17 +176,17 @@ static int hqx_decode_422(HQXContext *ctx, AVFrame *pic,
> -static int hqx_decode_422a(HQXContext *ctx, AVFrame *pic,
> - GetBitContext *gb, int x, int y)
> +static int hqx_decode_422a(void *c, GetBitContext *gb, int x, int y)
> {
> + HQXContext *ctx = (HQXContext *)c;
same
> @@ -226,19 +223,19 @@ static int hqx_decode_422a(HQXContext *ctx, AVFrame
> *pic,
> -static int hqx_decode_444(HQXContext *ctx, AVFrame *pic,
> - GetBitContext *gb, int x, int y)
> +static int hqx_decode_444(void *c, GetBitContext *gb, int x, int y)
> {
> + HQXContext *ctx = (HQXContext *)c;
same
> @@ -261,19 +258,19 @@ static int hqx_decode_444(HQXContext *ctx, AVFrame *pic,
> -static int hqx_decode_444a(HQXContext *ctx, AVFrame *pic,
> - GetBitContext *gb, int x, int y)
> +static int hqx_decode_444a(void *c, GetBitContext *gb, int x, int y)
> {
> + HQXContext *ctx = (HQXContext *)c;
same
> --- a/libavcodec/hqx.h
> +++ b/libavcodec/hqx.h
> @@ -22,6 +22,7 @@
> #define AVCODEC_HQX_H
>
> #include <stdint.h>
> +#include "libavutil/frame.h"
> #include "libavutil/mem.h"
> #include "get_bits.h"
> #include "hqxdsp.h"
nit: You could add an empty line while you're at it.
> @@ -47,12 +48,21 @@ typedef struct HQXAC {
>
> +typedef int (*mb_decode_func)(void *ctx, GetBitContext *gb, int x, int y);
> +
> typedef struct HQXContext {
> HQXDSPContext hqxdsp;
>
> + AVFrame *pic;
> + mb_decode_func decode_func;
Why not pass the correct type to the decode function instead of void*?
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel