[FFmpeg-devel] [PATCH 1/3] cljrenc: add AVOption to disable dither
Michael Niedermayer
michaelni at gmx.at
Fri Dec 9 18:28:55 CET 2011
On Fri, Dec 09, 2011 at 03:10:01PM +0000, Paul B Mahol wrote:
> On 12/9/11, Michael Niedermayer <michaelni at gmx.at> wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> > libavcodec/cljr.c | 24 +++++++++++++++++++++++-
> > 1 files changed, 23 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c
> > index 950b46a..2c3cf1e 100644
> > --- a/libavcodec/cljr.c
> > +++ b/libavcodec/cljr.c
> > @@ -25,12 +25,15 @@
> > */
> >
> > #include "avcodec.h"
> > +#include "libavutil/opt.h"
> > #include "get_bits.h"
> > #include "put_bits.h"
> >
> > typedef struct CLJRContext {
> > + AVClass *avclass;
>
> align vertically
> > AVCodecContext *avctx;
> > AVFrame picture;
> > + int dither_type;
> > } CLJRContext;
> >
> > static av_cold int common_init(AVCodecContext *avctx)
> > @@ -129,6 +132,7 @@ AVCodec ff_cljr_decoder = {
> > static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
> > int buf_size, void *data)
> > {
> > + CLJRContext *a = avctx->priv_data;
> > PutBitContext pb;
> > AVFrame *p = data;
> > int x, y;
> > @@ -144,6 +148,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned
> > char *buf,
> > uint8_t *cb = &p->data[1][y * p->linesize[1]];
> > uint8_t *cr = &p->data[2][y * p->linesize[2]];
> > for (x = 0; x < avctx->width; x += 4) {
> > + switch(a->dither_type){
>
> switch (a->dither_type) {
> > + case 0: dither = 0; break;
> > + case 1: dither = dither*1664525+1013904223; break;
>
> indentation is wrong
>
> adding spaces around * and + is imho better, and it keeps it in sync
> with rest of file.
changed and applied
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111209/21beea30/attachment.asc>
More information about the ffmpeg-devel
mailing list