]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/aacenc_utils.h
avcodec/h264: clean up and expand x86 function definitions
[ffmpeg] / libavcodec / aacenc_utils.h
index bb1dcb4361626a2090dcc1f03e984fbfaa5abb51..bef4c103f382a663a07678ce592ce25bc9a815cf 100644 (file)
@@ -63,7 +63,7 @@ static inline int quant(float coef, const float Q, const float rounding)
 }
 
 static inline void quantize_bands(int *out, const float *in, const float *scaled,
-                                  int size, float Q34, int is_signed, int maxval,
+                                  int size, int is_signed, int maxval, const float Q34,
                                   const float rounding)
 {
     int i;
@@ -252,6 +252,19 @@ static inline int ff_sfdelta_can_replace(const SingleChannelElement *sce,
         && sce->sf_idx[nextband[band]] <= (new_sf + SCALE_MAX_DIFF);
 }
 
+/**
+ * linear congruential pseudorandom number generator
+ *
+ * @param   previous_val    pointer to the current state of the generator
+ *
+ * @return  Returns a 32-bit pseudorandom integer
+ */
+static av_always_inline int lcg_random(unsigned previous_val)
+{
+    union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 };
+    return v.s;
+}
+
 #define ERROR_IF(cond, ...) \
     if (cond) { \
         av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \