[FFmpeg-cvslog] Merge commit '52567e8198669a1e7493c75771613f87a90466c3'

Hendrik Leppkes git at videolan.org
Sun Jun 26 20:23:50 CEST 2016


ffmpeg | branch: release/3.1 | Hendrik Leppkes <h.leppkes at gmail.com> | Sun Jun 26 14:19:48 2016 +0200| [e2836397f11c87573f7cb7f75319a7db248e59ac] | committer: Hendrik Leppkes

Merge commit '52567e8198669a1e7493c75771613f87a90466c3'

* commit '52567e8198669a1e7493c75771613f87a90466c3':
  get_bits: Drop some TRACE-level debug code

Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e2836397f11c87573f7cb7f75319a7db248e59ac
---

 libavcodec/get_bits.h   |   87 +----------------------------------------------
 libavcodec/golomb.h     |    6 ----
 libavcodec/h264_cavlc.c |    4 ---
 3 files changed, 1 insertion(+), 96 deletions(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index d566b9c..0f183e0 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -487,7 +487,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s)
         SKIP_BITS(name, gb, n);                                 \
     } while (0)
 
-#define GET_RL_VLC_INTERNAL(level, run, name, gb, table, bits,  \
+#define GET_RL_VLC(level, run, name, gb, table, bits,  \
                    max_depth, need_update)                      \
     do {                                                        \
         int n, nb_bits;                                         \
@@ -584,89 +584,4 @@ static inline int skip_1stop_8data_bits(GetBitContext *gb)
     return 0;
 }
 
-//#define TRACE
-
-#ifdef TRACE
-static inline void print_bin(int bits, int n)
-{
-    int i;
-
-    for (i = n - 1; i >= 0; i--)
-        av_log(NULL, AV_LOG_DEBUG, "%d", (bits >> i) & 1);
-    for (i = n; i < 24; i++)
-        av_log(NULL, AV_LOG_DEBUG, " ");
-}
-
-static inline int get_bits_trace(GetBitContext *s, int n, const char *file,
-                                 const char *func, int line)
-{
-    int r = get_bits(s, n);
-
-    print_bin(r, n);
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n",
-           r, n, r, get_bits_count(s) - n, file, func, line);
-
-    return r;
-}
-
-static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2],
-                                int bits, int max_depth, const char *file,
-                                const char *func, int line)
-{
-    int show  = show_bits(s, 24);
-    int pos   = get_bits_count(s);
-    int r     = get_vlc2(s, table, bits, max_depth);
-    int len   = get_bits_count(s) - pos;
-    int bits2 = show >> (24 - len);
-
-    print_bin(bits2, len);
-
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n",
-           bits2, len, r, pos, file, func, line);
-
-    return r;
-}
-
-#define GET_RL_VLC(level, run, name, gb, table, bits,           \
-                   max_depth, need_update)                      \
-    do {                                                        \
-        int show  = SHOW_UBITS(name, gb, 24);                   \
-        int len;                                                \
-        int pos = name ## _index;                               \
-                                                                \
-        GET_RL_VLC_INTERNAL(level, run, name, gb, table, bits,max_depth, need_update); \
-                                                                \
-        len = name ## _index - pos + 1;                         \
-        show = show >> (24 - len);                              \
-                                                                \
-        print_bin(show, len);                                   \
-                                                                \
-        av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d/%-3d rlv @%5d in %s %s:%d\n",\
-               show, len, run-1, level, pos, __FILE__, __PRETTY_FUNCTION__, __LINE__);\
-    } while (0)                                                 \
-
-
-static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
-                                  const char *func, int line)
-{
-    int show = show_bits(s, n);
-    int r    = get_xbits(s, n);
-
-    print_bin(show, n);
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n",
-           show, n, r, get_bits_count(s) - n, file, func, line);
-
-    return r;
-}
-
-#define get_bits(s, n)  get_bits_trace(s , n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_bits1(s)    get_bits_trace(s,  1, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_xbits(s, n) get_xbits_trace(s, n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-
-#define get_vlc(s, vlc)             get_vlc_trace(s, (vlc)->table, (vlc)->bits,   3, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#define get_vlc2(s, tab, bits, max) get_vlc_trace(s,          tab,        bits, max, __FILE__, __PRETTY_FUNCTION__, __LINE__)
-#else //TRACE
-#define GET_RL_VLC GET_RL_VLC_INTERNAL
-#endif
-
 #endif /* AVCODEC_GET_BITS_H */
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index d4df0b3..0d2af4b 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -409,8 +409,6 @@ static inline int get_ue(GetBitContext *s, const char *file, const char *func,
     int len  = get_bits_count(s) - pos;
     int bits = show >> (24 - len);
 
-    print_bin(bits, len);
-
     av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue  @%5d in %s %s:%d\n",
            bits, len, i, pos, file, func, line);
 
@@ -426,8 +424,6 @@ static inline int get_se(GetBitContext *s, const char *file, const char *func,
     int len  = get_bits_count(s) - pos;
     int bits = show >> (24 - len);
 
-    print_bin(bits, len);
-
     av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se  @%5d in %s %s:%d\n",
            bits, len, i, pos, file, func, line);
 
@@ -443,8 +439,6 @@ static inline int get_te(GetBitContext *s, int r, char *file, const char *func,
     int len  = get_bits_count(s) - pos;
     int bits = show >> (24 - len);
 
-    print_bin(bits, len);
-
     av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te  @%5d in %s %s:%d\n",
            bits, len, i, pos, file, func, line);
 
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index d01586d..3293c66 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -422,10 +422,6 @@ static inline int get_level_prefix(GetBitContext *gb){
     buf=GET_CACHE(re, gb);
 
     log= 32 - av_log2(buf);
-#ifdef TRACE
-    print_bin(buf>>(32-log), log);
-    av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d lpr @%5d in %s get_level_prefix\n", buf>>(32-log), log, log-1, get_bits_count(gb), __FILE__);
-#endif
 
     LAST_SKIP_BITS(re, gb, log);
     CLOSE_READER(re, gb);


======================================================================

diff --cc libavcodec/get_bits.h
index d566b9c,b225c13..0f183e0
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@@ -487,7 -445,7 +487,7 @@@ static inline const uint8_t *align_get_
          SKIP_BITS(name, gb, n);                                 \
      } while (0)
  
- #define GET_RL_VLC_INTERNAL(level, run, name, gb, table, bits,  \
 -#define GET_RL_VLC(level, run, name, gb, table, bits,           \
++#define GET_RL_VLC(level, run, name, gb, table, bits,  \
                     max_depth, need_update)                      \
      do {                                                        \
          int n, nb_bits;                                         \
@@@ -570,103 -528,4 +570,18 @@@ static inline int get_bits_left(GetBitC
      return gb->size_in_bits - get_bits_count(gb);
  }
  
 +static inline int skip_1stop_8data_bits(GetBitContext *gb)
 +{
 +    if (get_bits_left(gb) <= 0)
 +        return AVERROR_INVALIDDATA;
 +
 +    while (get_bits1(gb)) {
 +        skip_bits(gb, 8);
 +        if (get_bits_left(gb) <= 0)
 +            return AVERROR_INVALIDDATA;
 +    }
 +
 +    return 0;
 +}
 +
- //#define TRACE
- 
- #ifdef TRACE
- static inline void print_bin(int bits, int n)
- {
-     int i;
- 
-     for (i = n - 1; i >= 0; i--)
-         av_log(NULL, AV_LOG_DEBUG, "%d", (bits >> i) & 1);
-     for (i = n; i < 24; i++)
-         av_log(NULL, AV_LOG_DEBUG, " ");
- }
- 
- static inline int get_bits_trace(GetBitContext *s, int n, const char *file,
-                                  const char *func, int line)
- {
-     int r = get_bits(s, n);
- 
-     print_bin(r, n);
-     av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n",
-            r, n, r, get_bits_count(s) - n, file, func, line);
- 
-     return r;
- }
- 
- static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2],
-                                 int bits, int max_depth, const char *file,
-                                 const char *func, int line)
- {
-     int show  = show_bits(s, 24);
-     int pos   = get_bits_count(s);
-     int r     = get_vlc2(s, table, bits, max_depth);
-     int len   = get_bits_count(s) - pos;
-     int bits2 = show >> (24 - len);
- 
-     print_bin(bits2, len);
- 
-     av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n",
-            bits2, len, r, pos, file, func, line);
- 
-     return r;
- }
- 
- #define GET_RL_VLC(level, run, name, gb, table, bits,           \
-                    max_depth, need_update)                      \
-     do {                                                        \
-         int show  = SHOW_UBITS(name, gb, 24);                   \
-         int len;                                                \
-         int pos = name ## _index;                               \
-                                                                 \
-         GET_RL_VLC_INTERNAL(level, run, name, gb, table, bits,max_depth, need_update); \
-                                                                 \
-         len = name ## _index - pos + 1;                         \
-         show = show >> (24 - len);                              \
-                                                                 \
-         print_bin(show, len);                                   \
-                                                                 \
-         av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d/%-3d rlv @%5d in %s %s:%d\n",\
-                show, len, run-1, level, pos, __FILE__, __PRETTY_FUNCTION__, __LINE__);\
-     } while (0)                                                 \
- 
- 
- static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
-                                   const char *func, int line)
- {
-     int show = show_bits(s, n);
-     int r    = get_xbits(s, n);
- 
-     print_bin(show, n);
-     av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n",
-            show, n, r, get_bits_count(s) - n, file, func, line);
- 
-     return r;
- }
- 
- #define get_bits(s, n)  get_bits_trace(s , n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
- #define get_bits1(s)    get_bits_trace(s,  1, __FILE__, __PRETTY_FUNCTION__, __LINE__)
- #define get_xbits(s, n) get_xbits_trace(s, n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
- 
- #define get_vlc(s, vlc)             get_vlc_trace(s, (vlc)->table, (vlc)->bits,   3, __FILE__, __PRETTY_FUNCTION__, __LINE__)
- #define get_vlc2(s, tab, bits, max) get_vlc_trace(s,          tab,        bits, max, __FILE__, __PRETTY_FUNCTION__, __LINE__)
- #else //TRACE
- #define GET_RL_VLC GET_RL_VLC_INTERNAL
- #endif
- 
  #endif /* AVCODEC_GET_BITS_H */



More information about the ffmpeg-cvslog mailing list