cuvid: Add hwaccels and decoders for remaining supported formats
[ffmpeg.git] / libavcodec / ac3.h
index 542f79d..747f2f5 100644 (file)
 #define AC3_RENAME(x)           x ## _fixed
 #define AC3_NORM(norm)          (1<<24)/(norm)
 #define AC3_MUL(a,b)            ((((int64_t) (a)) * (b))>>12)
-#define AC3_RANGE(x)            (x)
+#define AC3_RANGE(x)            ((x)|(((x)&128)<<1))
+#define AC3_HEAVY_RANGE(x)      ((x)<<1)
 #define AC3_DYNAMIC_RANGE(x)    (x)
 #define AC3_SPX_BLEND(x)        (x)
 #define AC3_DYNAMIC_RANGE1      0
 
-#define INTFLOAT                int
-#define SHORTFLOAT              int16_t
+typedef int                     INTFLOAT;
+typedef int16_t                 SHORTFLOAT;
 
 #else /* USE_FIXED */
 
 #define AC3_NORM(norm)          (1.0f/(norm))
 #define AC3_MUL(a,b)            ((a) * (b))
 #define AC3_RANGE(x)            (dynamic_range_tab[(x)])
+#define AC3_HEAVY_RANGE(x)      (heavy_dynamic_range_tab[(x)])
 #define AC3_DYNAMIC_RANGE(x)    (powf(x,  s->drc_scale))
 #define AC3_SPX_BLEND(x)        (x)* (1.0f/32)
 #define AC3_DYNAMIC_RANGE1      1.0f
 
-#define INTFLOAT                float
-#define SHORTFLOAT              float
+typedef float                   INTFLOAT;
+typedef float                   SHORTFLOAT;
 
 #endif /* USE_FIXED */
 
-#define AC3_LEVEL(x)            ROUND15((x) * FIXR15(0.7071067811865476))
+#define AC3_LEVEL(x)            ROUND15((x) * FIXR15(M_SQRT1_2))
 
 /* pre-defined gain values */
-#define LEVEL_PLUS_3DB          1.4142135623730950
+#define LEVEL_PLUS_3DB          M_SQRT2
 #define LEVEL_PLUS_1POINT5DB    1.1892071150027209
 #define LEVEL_MINUS_1POINT5DB   0.8408964152537145
-#define LEVEL_MINUS_3DB         0.7071067811865476
+#define LEVEL_MINUS_3DB         M_SQRT1_2
 #define LEVEL_MINUS_4POINT5DB   0.5946035575013605
 #define LEVEL_MINUS_6DB         0.5000000000000000
 #define LEVEL_MINUS_9DB         0.3535533905932738
@@ -188,9 +190,7 @@ typedef struct AC3HeaderInfo {
     int surround_mix_level;                 ///< Surround mix level index
     uint16_t channel_map;
     int num_blocks;                         ///< number of audio blocks
-#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
     int dolby_surround_mode;
-#endif
     /** @} */
 
     /** @name Derived values
@@ -203,9 +203,6 @@ typedef struct AC3HeaderInfo {
     uint16_t frame_size;
     uint64_t channel_layout;
     /** @} */
-#if !AV_HAVE_INCOMPATIBLE_LIBAV_ABI
-    int dolby_surround_mode;
-#endif
 } AC3HeaderInfo;
 
 typedef enum {