summaryrefslogtreecommitdiffstats
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-14 03:43:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-14 03:48:22 +0200
commit91eb1b1525456efecc3154ca533b943d2916886e (patch)
tree34eb85a4cd6dbc0badfddc3da33038798da9d40a /libavcodec/mathops.h
parent90705aabe1a0b947d25f2a1d5fcbad85cfdfbc2c (diff)
parenta62d36697d3cefc705736d21fcaede425147b5f0 (diff)
downloadffmpeg-streaming-91eb1b1525456efecc3154ca533b943d2916886e.zip
ffmpeg-streaming-91eb1b1525456efecc3154ca533b943d2916886e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits) prores: add FATE tests id3v2: reduce the scope of some non-globally-used symbols/structures id3v2: cosmetics: move some declarations before the places they are used shorten: remove the flush function. shn: do not allow seeking in the raw shn demuxer. avformat: add AVInputFormat flag AVFMT_NO_BYTE_SEEK. avformat: update AVInputFormat allowed flags avformat: don't unconditionally call ff_read_frame_flush() when trying to seek. truespeech: use sizeof() instead of hardcoded sizes truespeech: remove unneeded variable, 'consumed' truespeech: simplify truespeech_read_frame() by using get_bits() truespeech: decode directly to output buffer instead of a temp buffer truespeech: check to make sure channels == 1 truespeech: check for large enough output buffer rather than truncating output truespeech: remove unneeded zero-size packet check. mlpdec: return meaningful error codes instead of -1 mlpdec: remove unnecessary wrapper function mlpdec: only calculate output size once mlpdec: validate that the reported channel count matches the actual output channel count pcm: reduce pointer type casting ... Conflicts: libavformat/avformat.h libavformat/id3v2.c libavformat/id3v2.h libavformat/utils.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r--libavcodec/mathops.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 0477cfd..1126ba6 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -116,7 +116,9 @@ static inline av_const int mid_pred(int a, int b, int c)
#ifndef sign_extend
static inline av_const int sign_extend(int val, unsigned bits)
{
- return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits);
+ unsigned shift = 8 * sizeof(int) - bits;
+ union { unsigned u; int s; } v = { (unsigned) val << shift };
+ return v.s >> shift;
}
#endif
OpenPOWER on IntegriCloud