On Thu, Apr 21, 2011 at 07:38:38PM -0700, rukhsana afroz wrote:
>
> I have attached new patch again.
>
> --- a/libavcodec/j2k.c
> +++ b/libavcodec/j2k.c
> @@ -105,18 +105,20 @@ static void tag_tree_zero(J2kTgtNode *t, int w, int h)
>
> -static int getnbctxno(int flag, int bandno)
> +static int getnbctxno(int flag, int bandno, int vert_causal_ctx_csty_symbol)
> {
> int h, v, d;
>
> - h = ((flag & J2K_T1_SIG_E) ? 1:0)+
> + h = ((flag & J2K_T1_SIG_E) ? 1:0)+
This is a stray cosmetic change that should not be in your patch.
> ((flag & J2K_T1_SIG_W) ? 1:0);
> - v = ((flag & J2K_T1_SIG_N) ? 1:0)+
> - ((flag & J2K_T1_SIG_S) ? 1:0);
> + v = ((flag & J2K_T1_SIG_N) ? 1:0);
> + if(!vert_causal_ctx_csty_symbol)
'if (', more below
> --- a/libavcodec/j2kdec.c
> +++ b/libavcodec/j2kdec.c
> @@ -303,6 +303,8 @@ static int get_cod(J2kDecoderContext *s, J2kCodingStyle
> *c, uint8_t *properties)
>
> + av_log(s->avctx, AV_LOG_DEBUG, "Inside get_cod\n");
These debug messages have no place in production code and should not be
part of patches you submit.
> @@ -592,7 +596,7 @@ static int decode_packets(J2kDecoderContext *s, J2kTile
> *tile)
>
> /* TIER-1 routines */
> -static void decode_sigpass(J2kT1Context *t1, int width, int height, int
> bpno, int bandno)
> +static void decode_sigpass(J2kT1Context *t1, int width, int height, int
> bpno, int bandno, int bpass_csty_symbol, int vert_causal_ctx_csty_symbol)
Please break this long line.
> @@ -601,10 +605,13 @@ static void decode_sigpass(J2kT1Context *t1, int width,
> int height, int bpno, in
> && !(t1->flags[y+1][x+1] & (J2K_T1_SIG | J2K_T1_VIS))){
> - if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states +
> ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno))){
> + vert_causal_ctx_csty_symbol =
> vert_causal_ctx_csty_symbol && (x == 3 && y == 3);
> + if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states +
> ff_j2k_getnbctxno(t1->flags[y+1][x+1], bandno, vert_causal_ctx_csty_symbol))){
if (...) {
> + if (bpass_csty_symbol)
> + t1->data[y][x] = ff_mqc_decode(&t1->mqc,
> t1->mqc.cx_states + ctxno) ? -mask : mask;
> + else
> + t1->data[y][x] = (ff_mqc_decode(&t1->mqc,
> t1->mqc.cx_states + ctxno) ^ xorbit) ? -mask : mask;
Get rid of all the tabs.
> @@ -697,14 +704,26 @@ static int decode_cblk(J2kDecoderContext *s,
> J2kCodingStyle *codsty, J2kT1Contex
> cblk->data[cblk->length] = 0xff;
> cblk->data[cblk->length+1] = 0xff;
>
> + //av_log(s->avctx, AV_LOG_ERROR,"decode_cblk passno: %d, bpno: %d\n",
> passno, bpno);
Please don't add commented-out debugging cruft.
> while(passno--){
> switch(pass_t){
> - case 0: decode_sigpass(t1, width, height, bpno+1, bandpos);
> + case 0: decode_sigpass(t1, width, height, bpno+1, bandpos,
> bpass_csty_symbol && (clnpass_cnt >= 4), vert_causal_ctx_csty_symbol);
Please break such long lines.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel