[FFmpeg-soc] [soc]: r385 - in dirac: dirac.c ffmpeg.diff

Michael Niedermayer michaelni at gmx.at
Fri Jul 13 22:01:36 CEST 2007


Hi

On Thu, Jul 12, 2007 at 12:34:28PM +0200, marco wrote:
> Author: marco
> Date: Thu Jul 12 12:34:28 2007
> New Revision: 385
> 
> Log:
> First attempt to get coefficients on the screen.
> 

[...]
> @@ -544,10 +548,10 @@ enum arith_context_indices {
>  #define ARITH_CONTEXT_COUNT (ARITH_CONTEXT_DC_SIGN + 1)
>  
>  /* XXX: Check the spec again on this.  */
> -typedef int arith_context_t[1];
> -static arith_context_t arith_contexts[ARITH_CONTEXT_COUNT];
> +//typedef int arith_context_t[1];
> +static int arith_contexts[ARITH_CONTEXT_COUNT];
>  
> -static void arith_init (GetBitContext *gb, int length) {
> +static void arith_init (AVCodecContext *avctx, GetBitContext *gb, int length) {
>      int i;
>  
>      align_get_bits(gb);

all the arithmetic coding stuff should be moved into its own file(s)
eventually ...


[...]
> -    int bottom = (subband_width(width, level) * x) / s->codeblocksh[level];
> -    int top = (subband_width(width, level) * (x + 1)) / s->codeblocksh[level];
> -    int left = (subband_height(height, level) * y) / s->codeblocksv[level];
> -    int right = (subband_height(height, level) * (y + 1)) / s->codeblocksv[level];
> +    int bottom = (subband_width(avctx, level) * x) / s->codeblocksh[level];
> +    int top = (subband_width(avctx, level) * (x + 1)) / s->codeblocksh[level];
> +    int left = (subband_height(avctx, level) * y) / s->codeblocksv[level];
> +    int right = (subband_height(avctx, level) * (y + 1)) / s->codeblocksv[level];

this could be aligned like

int bottom = (subband_width (avctx, level) *  x     ) / s->codeblocksh[level];
int top    = (subband_width (avctx, level) * (x + 1)) / s->codeblocksh[level];
int left   = (subband_height(avctx, level) *  y     ) / s->codeblocksv[level];
int right  = (subband_height(avctx, level) * (y + 1)) / s->codeblocksv[level];

which makes it somewhat more readable IMHO


[...]
> +            if (h > 0) {
> +                if (v > 0) {
> +                    /* Use 3 coefficients for prediction.  */
> +                    pred = (data[x + y * width - 1]
> +                            + data[x + (y - 1) * width]
> +                            + data[x + (y - 1) * width - 1]) / 3;
> +                } else {
> +                    /* Just use the coefficient left of this one.  */
> +                    pred = data[x + y * width - 1];
> +                }
> +            } else {
> +                if (v > 0)
> +                    pred = data[x + (y - 1) * width];
> +                else
> +                    pred = 0;
> +            }

pred=0;
if(h>0)
    pred += data[x + y * width - 1];
if(v>0)
    pred += data[x + (y - 1) * width];
if(h>0 && v>0){
    pred += data[x + (y - 1) * width - 1];
    pred /=3;
}


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070713/b8a91a84/attachment.pgp>


More information about the FFmpeg-soc mailing list