Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
  2. index cda14e7ac1..fbcee94195 100644
  3. --- a/libavcodec/mlpenc.c
  4. +++ b/libavcodec/mlpenc.c
  5. @@ -1249,7 +1249,7 @@ static void input_data_internal(MLPEncodeContext *ctx, const uint8_t *samples,
  6. uint32_t abs_sample;
  7. int32_t sample;
  8.  
  9. - sample = is24 ? *samples_32++ >> 8 : *samples_16++ * 256U;
  10. + sample = is24 ? *samples_32++ >> 8 : *samples_16++ * 256;
  11.  
  12. /* TODO Find out if number_sbits can be used for negative values. */
  13. abs_sample = FFABS(sample);
  14. @@ -1611,7 +1611,7 @@ static void no_codebook_bits(MLPEncodeContext *ctx,
  15.  
  16. /* If all samples are the same (lsb_bits == 0), offset must be
  17. * adjusted because of sign_shift. */
  18. - offset = min + diff / 2 + !!lsb_bits;
  19. + offset = min + (int)(diff / 2) + !!lsb_bits;
  20.  
  21. bo->offset = offset;
  22. bo->lsb_bits = lsb_bits;
  23. @@ -1792,7 +1792,7 @@ static void determine_bits(MLPEncodeContext *ctx)
  24. #define SAMPLE_MAX(bitdepth) ((1 << (bitdepth - 1)) - 1)
  25. #define SAMPLE_MIN(bitdepth) (~SAMPLE_MAX(bitdepth))
  26.  
  27. -#define MSB_MASK(bits) (-(1u << (bits)))
  28. +#define MSB_MASK(bits) (-(int)(1u << (bits)))
  29.  
  30. /** Applies the filter to the current samples, and saves the residual back
  31. * into the samples buffer. If the filter is too bad and overflows the
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement