[Ffmpeg-devel] Weird line in cabac.h
Jindrich Makovicka
makovick
Wed Oct 18 08:21:40 CEST 2006
On Tue, 17 Oct 2006 19:50:07 +0100 (BST)
M?ns Rullg?rd <mru at inprovide.com> wrote:
>
> Steve Lhomme said:
> > Hi everyone,
> >
> > We're currently adding most of the current FFMPEG to DrFFMPEG and
> > MSVC spits a warning on the following line in cabac.h:
>
> Telling us the actual warning might have been helpful, don't you
> think?
>
> > static void put_cabac(CABACContext *c, uint8_t * const state, int
> > bit){ int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + *state];
> >
> [...]
IMO there should be ff_h264_lps_range[0][2*(c->range&0xC0) + *state];
^^^
or better
Index: cabac.c
===================================================================
--- cabac.c (revision 6725)
+++ cabac.c (working copy)
@@ -51,7 +51,7 @@
};
uint8_t ff_h264_mlps_state[4*64];
-uint8_t ff_h264_lps_range[4][2*64];
+uint8_t ff_h264_lps_range[4*2*64];
uint8_t ff_h264_lps_state[2*64];
uint8_t ff_h264_mps_state[2*64];
@@ -152,8 +152,8 @@
for(i=0; i<64; i++){
for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift
we save
- ff_h264_lps_range[j][2*i+0]=
- ff_h264_lps_range[j][2*i+1]= lps_range[i][j];
+ ff_h264_lps_range[j*2*64+2*i+0]=
+ ff_h264_lps_range[j*2*64+2*i+1]= lps_range[i][j];
}
ff_h264_mlps_state[128+2*i+0]=
Index: cabac.h
===================================================================
--- cabac.h (revision 6725)
+++ cabac.h (working copy)
@@ -48,7 +48,7 @@
}CABACContext;
extern uint8_t ff_h264_mlps_state[4*64];
-extern uint8_t ff_h264_lps_range[4][2*64]; ///< rangeTabLPS
+extern uint8_t ff_h264_lps_range[4*2*64]; ///< rangeTabLPS
extern uint8_t ff_h264_mps_state[2*64]; ///< transIdxMPS
extern uint8_t ff_h264_lps_state[2*64]; ///< transIdxLPS
extern const uint8_t ff_h264_norm_shift[512];
@@ -524,7 +524,7 @@
#endif /* BRANCHLESS_CABAC_DECODER */
#else /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */
int s = *state;
- int RangeLPS= ff_h264_lps_range[0][2*(c->range&0xC0) + s];
+ int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s];
int bit, lps_mask attribute_unused;
c->range -= RangeLPS;
--
Jindrich Makovicka
More information about the ffmpeg-devel
mailing list