]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264.h
mjpegdec: print nb_components too in pict debug info
[ffmpeg] / libavcodec / h264.h
index d448fc333099eb8c5cb5673d1a582dcf559c4a7d..374cd163ec81b822dbfc0cd24346bacc787e6209 100644 (file)
 #define interlaced_dct interlaced_dct_is_a_bad_name
 #define mb_intra mb_intra_is_not_initialized_see_mb_type
 
-#define CHROMA_DC_COEFF_TOKEN_VLC_BITS 8
-#define COEFF_TOKEN_VLC_BITS           8
-#define TOTAL_ZEROS_VLC_BITS           9
-#define CHROMA_DC_TOTAL_ZEROS_VLC_BITS 3
-#define RUN_VLC_BITS                   3
-#define RUN7_VLC_BITS                  6
-
 #define MAX_SPS_COUNT 32
 #define MAX_PPS_COUNT 256
 
@@ -53,6 +46,8 @@
 
 #define MAX_DELAYED_PIC_COUNT 16
 
+#define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes
+
 /* Compiling in interlaced support reduces the speed
  * of progressive decoding by about 2%. */
 #define ALLOW_INTERLACE
@@ -92,6 +87,7 @@
 #define CABAC h->pps.cabac
 #endif
 
+#define CHROMA422 (h->sps.chroma_format_idc == 2)
 #define CHROMA444 (h->sps.chroma_format_idc == 3)
 
 #define EXTENDED_SAR          255
@@ -582,6 +578,10 @@ typedef struct H264Context{
     // Timestamp stuff
     int sei_buffering_period_present;  ///< Buffering period SEI flag
     int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs
+
+    int cur_chroma_format_idc;
+
+    int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low
 }H264Context;
 
 
@@ -809,7 +809,7 @@ static av_always_inline void write_back_non_zero_count(H264Context *h){
     AV_COPY32(&nnz[32], &nnz_cache[4+8*11]);
     AV_COPY32(&nnz[36], &nnz_cache[4+8*12]);
 
-    if(CHROMA444){
+    if(!h->s.chroma_y_shift){
         AV_COPY32(&nnz[24], &nnz_cache[4+8* 8]);
         AV_COPY32(&nnz[28], &nnz_cache[4+8* 9]);
         AV_COPY32(&nnz[40], &nnz_cache[4+8*13]);