diff options
7 files changed, 46 insertions, 33 deletions
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/audioconvert.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/audioconvert.h index 46ba3d392..81b6cded3 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/audioconvert.h +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/audioconvert.h @@ -24,7 +24,7 @@ #define AVCODEC_AUDIOCONVERT_H /** - * @file libavcodec/audioconvert.h + * @file * Audio format conversion routines */ @@ -103,9 +103,9 @@ void av_audio_convert_free(AVAudioConvert *ctx); /** * Convert between audio sample formats * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. - * @param[in] out_stride distance between consecutive input samples (measured in bytes) + * @param[in] out_stride distance between consecutive output samples (measured in bytes) * @param[in] in array of input buffers for each channel - * @param[in] in_stride distance between consecutive output samples (measured in bytes) + * @param[in] in_stride distance between consecutive input samples (measured in bytes) * @param len length of audio frame size (measured in samples) */ int av_audio_convert(AVAudioConvert *ctx, diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/eval.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/eval.h index 5f208e599..d0004b1a1 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/eval.h +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/eval.h @@ -78,7 +78,7 @@ AVExpr *ff_parse_expr(const char *s, double ff_eval_expr(AVExpr * e, const double *const_value, void *opaque); /** - * Frees a parsed expression previously created with ff_parse(). + * Frees a parsed expression previously created with ff_parse_expr(). */ void ff_free_expr(AVExpr *e); diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.c index a33b94491..6f09ef25d 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.c +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/golomb.c @@ -20,7 +20,7 @@ */
/**
- * @file golomb.c
+ * @file
* @brief
* exp golomb vlc stuff
* @author Michael Niedermayer <michaelni@gmx.at>
@@ -29,7 +29,7 @@ #include "libavutil/common.h"
const uint8_t ff_golomb_vlc_len[512]={
-14,13,12,12,11,11,11,11,10,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+19,17,15,15,13,13,13,13,11,11,11,11,11,11,11,11,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
@@ -48,7 +48,7 @@ const uint8_t ff_golomb_vlc_len[512]={ };
const uint8_t ff_ue_golomb_vlc_code[512]={
-31,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
+32,32,32,32,32,32,32,32,31,32,32,32,32,32,32,32,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
@@ -67,7 +67,7 @@ const uint8_t ff_ue_golomb_vlc_code[512]={ };
const int8_t ff_se_golomb_vlc_code[512]={
- 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 8, -8, 9, -9, 10,-10, 11,-11, 12,-12, 13,-13, 14,-14, 15,-15,
+ 17, 17, 17, 17, 17, 17, 17, 17, 16, 17, 17, 17, 17, 17, 17, 17, 8, -8, 9, -9, 10,-10, 11,-11, 12,-12, 13,-13, 14,-14, 15,-15,
4, 4, 4, 4, -4, -4, -4, -4, 5, 5, 5, 5, -5, -5, -5, -5, 6, 6, 6, 6, -6, -6, -6, -6, 7, 7, 7, 7, -7, -7, -7, -7,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp3.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp3.c index 631f0f282..b3b8c1d44 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp3.c +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/vp3.c @@ -385,8 +385,15 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) } else {
/* unpack the list of partially-coded superblocks */
- bit = get_bits1(gb);
+ bit = get_bits1(gb) ^ 1;
+ current_run = 0;
+
while (current_superblock < s->superblock_count && get_bits_left(gb) > 0) {
+ if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
+ bit = get_bits1(gb);
+ else
+ bit ^= 1;
+
current_run = get_vlc2(gb,
s->superblock_run_length_vlc.table, 6, 2) + 1;
if (current_run == 34)
@@ -402,11 +409,6 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) current_superblock += current_run;
if (bit)
num_partial_superblocks += current_run;
-
- if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
- bit = get_bits1(gb);
- else
- bit ^= 1;
}
/* unpack the list of fully coded superblocks if any of the blocks were
@@ -415,9 +417,17 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) int superblocks_decoded = 0;
current_superblock = 0;
- bit = get_bits1(gb);
+ bit = get_bits1(gb) ^ 1;
+ current_run = 0;
+
while (superblocks_decoded < s->superblock_count - num_partial_superblocks
&& get_bits_left(gb) > 0) {
+
+ if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
+ bit = get_bits1(gb);
+ else
+ bit ^= 1;
+
current_run = get_vlc2(gb,
s->superblock_run_length_vlc.table, 6, 2) + 1;
if (current_run == 34)
@@ -436,11 +446,6 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) }
}
superblocks_decoded += current_run;
-
- if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
- bit = get_bits1(gb);
- else
- bit ^= 1;
}
}
@@ -807,9 +812,15 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) for (qpi = 0; qpi < s->nqps-1 && num_blocks > 0; qpi++) {
i = blocks_decoded = num_blocks_at_qpi = 0;
- bit = get_bits1(gb);
+ bit = get_bits1(gb) ^ 1;
+ run_length = 0;
do {
+ if (run_length == MAXIMUM_LONG_BIT_RUN)
+ bit = get_bits1(gb);
+ else
+ bit ^= 1;
+
run_length = get_vlc2(gb, s->superblock_run_length_vlc.table, 6, 2) + 1;
if (run_length == 34)
run_length += get_bits(gb, 12);
@@ -827,11 +838,6 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) j++;
}
}
-
- if (run_length == MAXIMUM_LONG_BIT_RUN)
- bit = get_bits1(gb);
- else
- bit ^= 1;
} while (blocks_decoded < num_blocks && get_bits_left(gb) > 0);
num_blocks -= num_blocks_at_qpi;
@@ -1859,8 +1865,9 @@ static int vp3_decode_frame(AVCodecContext *avctx, vp3_draw_horiz_band(s, s->height);
/* MPC Custom code begin */
+#if 0
/* ffdshow custom code (begin) */
- /*if (s->theora && avctx->time_base.num){
+ if (s->theora && avctx->time_base.num){
if (avctx->granulepos>-1){
s->granulepos=avctx->granulepos;
}else{
@@ -1878,8 +1885,9 @@ static int vp3_decode_frame(AVCodecContext *avctx, }
s->current_frame.reordered_opaque = 10000000LL * theora_granule_frame(s,s->granulepos) * avctx->time_base.den / avctx->time_base.num;
s->current_frame.pict_type=s->keyframe?FF_I_TYPE:FF_P_TYPE;
- } */
+ }
/* ffdshow custom code (end) */
+#endif
/* MPC custom code end*/
*data_size=sizeof(AVFrame);
@@ -2249,7 +2257,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) AVCodec theora_decoder = {
"theora",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_THEORA,
sizeof(Vp3DecodeContext),
/*.init = */theora_decode_init,
@@ -2267,7 +2275,7 @@ AVCodec theora_decoder = { AVCodec vp3_decoder = {
"vp3",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_VP3,
sizeof(Vp3DecodeContext),
/*.init = */vp3_decode_init,
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.c index 4245a9672..5d662e8c3 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.c +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.c @@ -22,8 +22,9 @@ //#include <fcntl.h> #include "timer.h" #include "random_seed.h" +#include "avutil.h" -uint32_t ff_random_get_seed(void) +uint32_t av_get_random_seed(void) { uint32_t seed; /* ffdshow custom code */ diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.h index a0b10d028..56520207d 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.h +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/random_seed.h @@ -27,6 +27,6 @@ /** * Gets a seed to use in conjunction with random functions. */ -uint32_t ff_random_get_seed(void); +uint32_t av_get_random_seed(void); #endif /* AVUTIL_RANDOM_SEED_H */ diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/rational.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/rational.c index 507444435..274fa251d 100644 --- a/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/rational.c +++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavutil/rational.c @@ -20,7 +20,7 @@ */
/**
- * @file libavutil/rational.c
+ * @file
* rational numbers
* @author Michael Niedermayer <michaelni@gmx.at>
*/
@@ -100,6 +100,10 @@ AVRational av_d2q(double d, int max){ #define LOG2 0.69314718055994530941723212145817656807550013436025
int exponent= FFMAX( (int)(log(fabs(d) + 1e-20)/LOG2), 0);
int64_t den= 1LL << (61 - exponent);
+#ifdef __GNUC__
+ if (isnan(d))
+ return (AVRational){0,0};
+#endif
av_reduce(&a.num, &a.den, (int64_t)(d * den + 0.5), den, max);
return a;
|