Mercurial > libavcodec.hg
comparison noise_bsf.c @ 6131:969b9d3d3f45 libavcodec
Randomly change the amount of noise if nothing is explicitly set.
author | michael |
---|---|
date | Tue, 08 Jan 2008 00:25:25 +0000 |
parents | 32cd5a37161b |
children |
comparison
equal
deleted
inserted
replaced
6130:057c243a4e3b | 6131:969b9d3d3f45 |
---|---|
22 | 22 |
23 | 23 |
24 static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, | 24 static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, |
25 uint8_t **poutbuf, int *poutbuf_size, | 25 uint8_t **poutbuf, int *poutbuf_size, |
26 const uint8_t *buf, int buf_size, int keyframe){ | 26 const uint8_t *buf, int buf_size, int keyframe){ |
27 int amount= args ? atoi(args) : 10000; | |
28 unsigned int *state= bsfc->priv_data; | 27 unsigned int *state= bsfc->priv_data; |
28 int amount= args ? atoi(args) : (*state % 10001+1); | |
29 int i; | 29 int i; |
30 | 30 |
31 *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 31 *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE); |
32 | 32 |
33 memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 33 memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); |