[FFmpeg-devel] [PATCH] fix compilation when BRANCHLESS_CABAC_DECODER is not set

Michael Niedermayer michaelni
Thu Dec 11 19:10:45 CET 2008


On Thu, Dec 11, 2008 at 06:47:43PM +0100, Reimar D?ffinger wrote:
> Hello,
> some of the conditions are wrong so compilation false when commenting the

fails?


> #define BRANCHLESS_CABAC_DECODER 1
> in cabac.h.
> Attached patch fixes it.

> Index: libavcodec/i386/h264_i386.h
> ===================================================================
> --- libavcodec/i386/h264_i386.h	(revision 16055)
> +++ libavcodec/i386/h264_i386.h	(working copy)
> @@ -35,7 +35,8 @@
>  //as that would make optimization work hard)
>  #if defined(ARCH_X86) && defined(HAVE_7REGS)     && \
>      defined(HAVE_EBX_AVAILABLE)                  && \
> -    !defined(BROKEN_RELOCATIONS)
> +    !defined(BROKEN_RELOCATIONS)                 && \
> +    defined(BRANCHLESS_CABAC_DECODER)
>  static int decode_significance_x86(CABACContext *c, int max_coeff,
>                                     uint8_t *significant_coeff_ctx_base,
>                                     int *index){
> @@ -150,6 +151,7 @@
>      return coeff_count;
>  }
>  #endif /* defined(ARCH_X86) && defined(HAVE_7REGS) &&                 */
> -       /* defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) */
> +       /* defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) && */
> +       /* defined(BRANCHLESS_CABAC_DECODER)                              */
>  
>  #endif /* AVCODEC_I386_H264_I386_H */
> Index: libavcodec/h264.c
> ===================================================================
> --- libavcodec/h264.c	(revision 16055)
> +++ libavcodec/h264.c	(working copy)
> @@ -5199,7 +5212,8 @@
>              index[coeff_count++] = last;\
>          }
>          const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
> -#if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS)
> +#if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS) && \
> +    defined(BRANCHLESS_CABAC_DECODER)
>          coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off);
>      } else {
>          coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);

I wonder if it wouldnt be more correct to implement these functions for
the other case instead of disabling ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081211/e82a1144/attachment.pgp>



More information about the ffmpeg-devel mailing list