ffmpeg | branch: master | Mans Rullgard <mans(a)mansr.com> | Thu Mar 31 01:28:08 2011 +0100| [7f6e05cdfd1242a6774e89283b6e2cefde191590] | committer: Mans Rullgard
ac3enc: simplify sym_quant()
These expressions are equivalent since levels is always odd, and
overflow is impossible due to the constraints set by the assert().
Signed-off-by: Mans Rullgard <mans(a)mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f6e05cdfd1242a67…
---
libavcodec/ac3enc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 18e4dae..a869d7d 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1192,7 +1192,7 @@ static int compute_bit_allocation(AC3EncodeContext *s)
*/
static inline int sym_quant(int c, int e, int levels)
{
- int v = ((((levels * c) >> (24 - e)) + 1) >> 1) + (levels >> 1);
+ int v = (((levels * c) >> (24 - e)) + levels) >> 1;
av_assert2(v >= 0 && v < levels);
return v;
}
ffmpeg | branch: master | Alex Converse <aconverse(a)google.com> | Mon Mar 28 13:54:18 2011 -0700| [9dd94f8379a0f7b3c820bf73c45fa888971c7432] | committer: Anton Khirnov
mov: Add support for zero-sized stsc runs.
A zero sized stsc run doesn't make a lot of sense but the spec does not
prohibit them and MPlayer VLC demuxers support them.
Signed-off-by: Anton Khirnov <anton(a)khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9dd94f8379a0f7b3c…
---
libavformat/mov.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 94f19a6..b57c1aa 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1553,7 +1553,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
for (i = 0; i < sc->chunk_count; i++) {
current_offset = sc->chunk_offsets[i];
- if (stsc_index + 1 < sc->stsc_count &&
+ while (stsc_index + 1 < sc->stsc_count &&
i + 1 == sc->stsc_data[stsc_index + 1].first)
stsc_index++;
for (j = 0; j < sc->stsc_data[stsc_index].count; j++) {