Compare commits
34 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
61f55565fb | ||
![]() |
b6b46db9e4 | ||
![]() |
21d99be9dc | ||
![]() |
c2a2ad133e | ||
![]() |
b6187e48db | ||
![]() |
8af11e51f2 | ||
![]() |
f597825052 | ||
![]() |
7d704f5127 | ||
![]() |
7b6b9be861 | ||
![]() |
374409eb1a | ||
![]() |
a352fedb24 | ||
![]() |
c92068430d | ||
![]() |
274a5b7cdb | ||
![]() |
eb975b1c8b | ||
![]() |
84648d33ba | ||
![]() |
4b8a0b058d | ||
![]() |
1de90fd375 | ||
![]() |
c8b37fd03d | ||
![]() |
b37131f798 | ||
![]() |
95345e942c | ||
![]() |
878a7d1573 | ||
![]() |
bd968d260a | ||
![]() |
00c5cf4beb | ||
![]() |
87757508ab | ||
![]() |
6a57021cf9 | ||
![]() |
f66418afba | ||
![]() |
f20f79307b | ||
![]() |
d1bc77d86c | ||
![]() |
91d5da9321 | ||
![]() |
08ddfb77a1 | ||
![]() |
a0352d01e9 | ||
![]() |
2ff36ef521 | ||
![]() |
7e33a66c0e | ||
![]() |
893cf1b1ae |
2
Doxyfile
2
Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 0.7.3
|
PROJECT_NUMBER = 0.7.4
|
||||||
|
|
||||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||||
# base path where the generated documentation will be put.
|
# base path where the generated documentation will be put.
|
||||||
|
24
cmdutils.c
24
cmdutils.c
@@ -574,12 +574,13 @@ void show_banner(void)
|
|||||||
print_all_libs_info(stderr, INDENT|SHOW_VERSION);
|
print_all_libs_info(stderr, INDENT|SHOW_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_version(void) {
|
int opt_version(const char *opt, const char *arg) {
|
||||||
printf("%s " FFMPEG_VERSION "\n", program_name);
|
printf("%s " FFMPEG_VERSION "\n", program_name);
|
||||||
print_all_libs_info(stdout, SHOW_VERSION);
|
print_all_libs_info(stdout, SHOW_VERSION);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_license(void)
|
int opt_license(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
printf(
|
printf(
|
||||||
#if CONFIG_NONFREE
|
#if CONFIG_NONFREE
|
||||||
@@ -646,9 +647,10 @@ void show_license(void)
|
|||||||
program_name, program_name, program_name
|
program_name, program_name, program_name
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_formats(void)
|
int opt_formats(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
AVInputFormat *ifmt=NULL;
|
AVInputFormat *ifmt=NULL;
|
||||||
AVOutputFormat *ofmt=NULL;
|
AVOutputFormat *ofmt=NULL;
|
||||||
@@ -695,9 +697,10 @@ void show_formats(void)
|
|||||||
name,
|
name,
|
||||||
long_name ? long_name:" ");
|
long_name ? long_name:" ");
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_codecs(void)
|
int opt_codecs(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
AVCodec *p=NULL, *p2;
|
AVCodec *p=NULL, *p2;
|
||||||
const char *last_name;
|
const char *last_name;
|
||||||
@@ -771,9 +774,10 @@ void show_codecs(void)
|
|||||||
"even though both encoding and decoding are supported. For example, the h263\n"
|
"even though both encoding and decoding are supported. For example, the h263\n"
|
||||||
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
|
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
|
||||||
"worse.\n");
|
"worse.\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_bsfs(void)
|
int opt_bsfs(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
AVBitStreamFilter *bsf=NULL;
|
AVBitStreamFilter *bsf=NULL;
|
||||||
|
|
||||||
@@ -781,9 +785,10 @@ void show_bsfs(void)
|
|||||||
while((bsf = av_bitstream_filter_next(bsf)))
|
while((bsf = av_bitstream_filter_next(bsf)))
|
||||||
printf("%s\n", bsf->name);
|
printf("%s\n", bsf->name);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_protocols(void)
|
int opt_protocols(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
URLProtocol *up=NULL;
|
URLProtocol *up=NULL;
|
||||||
|
|
||||||
@@ -799,9 +804,10 @@ void show_protocols(void)
|
|||||||
up->url_write ? 'O' : '.',
|
up->url_write ? 'O' : '.',
|
||||||
up->url_seek ? 'S' : '.',
|
up->url_seek ? 'S' : '.',
|
||||||
up->name);
|
up->name);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_filters(void)
|
int opt_filters(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
AVFilter av_unused(**filter) = NULL;
|
AVFilter av_unused(**filter) = NULL;
|
||||||
|
|
||||||
@@ -810,9 +816,10 @@ void show_filters(void)
|
|||||||
while ((filter = av_filter_next(filter)) && *filter)
|
while ((filter = av_filter_next(filter)) && *filter)
|
||||||
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
|
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
|
||||||
#endif
|
#endif
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_pix_fmts(void)
|
int opt_pix_fmts(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
enum PixelFormat pix_fmt;
|
enum PixelFormat pix_fmt;
|
||||||
|
|
||||||
@@ -843,6 +850,7 @@ void show_pix_fmts(void)
|
|||||||
pix_desc->nb_components,
|
pix_desc->nb_components,
|
||||||
av_get_bits_per_pixel(pix_desc));
|
av_get_bits_per_pixel(pix_desc));
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int read_yesno(void)
|
int read_yesno(void)
|
||||||
|
26
cmdutils.h
26
cmdutils.h
@@ -62,7 +62,7 @@ void uninit_opts(void);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Trivial log callback.
|
* Trivial log callback.
|
||||||
* Only suitable for show_help and similar since it lacks prefix handling.
|
* Only suitable for opt_help and similar since it lacks prefix handling.
|
||||||
*/
|
*/
|
||||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
|
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
|
||||||
|
|
||||||
@@ -177,50 +177,58 @@ void show_banner(void);
|
|||||||
* Print the version of the program to stdout. The version message
|
* Print the version of the program to stdout. The version message
|
||||||
* depends on the current versions of the repository and of the libav*
|
* depends on the current versions of the repository and of the libav*
|
||||||
* libraries.
|
* libraries.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_version(void);
|
int opt_version(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print the license of the program to stdout. The license depends on
|
* Print the license of the program to stdout. The license depends on
|
||||||
* the license of the libraries compiled into the program.
|
* the license of the libraries compiled into the program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_license(void);
|
int opt_license(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a listing containing all the formats supported by the
|
* Print a listing containing all the formats supported by the
|
||||||
* program.
|
* program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_formats(void);
|
int opt_formats(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a listing containing all the codecs supported by the
|
* Print a listing containing all the codecs supported by the
|
||||||
* program.
|
* program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_codecs(void);
|
int opt_codecs(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a listing containing all the filters supported by the
|
* Print a listing containing all the filters supported by the
|
||||||
* program.
|
* program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_filters(void);
|
int opt_filters(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a listing containing all the bit stream filters supported by the
|
* Print a listing containing all the bit stream filters supported by the
|
||||||
* program.
|
* program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_bsfs(void);
|
int opt_bsfs(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a listing containing all the protocols supported by the
|
* Print a listing containing all the protocols supported by the
|
||||||
* program.
|
* program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_protocols(void);
|
int opt_protocols(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a listing containing all the pixel formats supported by the
|
* Print a listing containing all the pixel formats supported by the
|
||||||
* program.
|
* program.
|
||||||
|
* This option processing function does not utilize the arguments.
|
||||||
*/
|
*/
|
||||||
void show_pix_fmts(void);
|
int opt_pix_fmts(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a positive value if a line read from standard input
|
* Return a positive value if a line read from standard input
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
|
{ "L", OPT_EXIT, {(void*)opt_license}, "show license" },
|
||||||
{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
|
{ "h", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||||
{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
|
{ "?", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||||
{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
|
{ "help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||||
{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
|
{ "-help", OPT_EXIT, {(void*)opt_help}, "show help" },
|
||||||
{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
|
{ "version", OPT_EXIT, {(void*)opt_version}, "show version" },
|
||||||
{ "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" },
|
{ "formats" , OPT_EXIT, {(void*)opt_formats }, "show available formats" },
|
||||||
{ "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" },
|
{ "codecs" , OPT_EXIT, {(void*)opt_codecs }, "show available codecs" },
|
||||||
{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" },
|
{ "bsfs" , OPT_EXIT, {(void*)opt_bsfs }, "show available bit stream filters" },
|
||||||
{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" },
|
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
|
||||||
{ "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" },
|
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
|
||||||
{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" },
|
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
|
||||||
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
|
||||||
|
1
configure
vendored
1
configure
vendored
@@ -2537,6 +2537,7 @@ case $target_os in
|
|||||||
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
|
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
|
||||||
;;
|
;;
|
||||||
gnu)
|
gnu)
|
||||||
|
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||||
;;
|
;;
|
||||||
qnx)
|
qnx)
|
||||||
add_cppflags -D_QNX_SOURCE
|
add_cppflags -D_QNX_SOURCE
|
||||||
|
17
ffmpeg.c
17
ffmpeg.c
@@ -2946,7 +2946,7 @@ static int opt_frame_pix_fmt(const char *opt, const char *arg)
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
show_pix_fmts();
|
opt_pix_fmts(NULL, NULL);
|
||||||
ffmpeg_exit(0);
|
ffmpeg_exit(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -4077,16 +4077,18 @@ static void parse_matrix_coeffs(uint16_t *dest, const char *str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_inter_matrix(const char *opt, const char *arg)
|
static int opt_inter_matrix(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||||
parse_matrix_coeffs(inter_matrix, arg);
|
parse_matrix_coeffs(inter_matrix, arg);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_intra_matrix(const char *opt, const char *arg)
|
static int opt_intra_matrix(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
|
||||||
parse_matrix_coeffs(intra_matrix, arg);
|
parse_matrix_coeffs(intra_matrix, arg);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_usage(void)
|
static void show_usage(void)
|
||||||
@@ -4096,7 +4098,7 @@ static void show_usage(void)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_help(void)
|
static int opt_help(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
AVCodec *c;
|
AVCodec *c;
|
||||||
AVOutputFormat *oformat = NULL;
|
AVOutputFormat *oformat = NULL;
|
||||||
@@ -4151,6 +4153,7 @@ static void show_help(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
av_opt_show2(sws_opts, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
|
av_opt_show2(sws_opts, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int opt_target(const char *opt, const char *arg)
|
static int opt_target(const char *opt, const char *arg)
|
||||||
@@ -4381,11 +4384,13 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_passlogfile(const char *opt, const char *arg)
|
static int opt_passlogfile(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
pass_logfilename_prefix = arg;
|
pass_logfilename_prefix = arg;
|
||||||
#if CONFIG_LIBX264_ENCODER
|
#if CONFIG_LIBX264_ENCODER
|
||||||
opt_default("passlogfile", arg);
|
return opt_default("passlogfile", arg);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
ffplay.c
7
ffplay.c
@@ -212,7 +212,7 @@ typedef struct VideoState {
|
|||||||
int refresh;
|
int refresh;
|
||||||
} VideoState;
|
} VideoState;
|
||||||
|
|
||||||
static void show_help(void);
|
static int opt_help(const char *opt, const char *arg);
|
||||||
|
|
||||||
/* options specified by the user */
|
/* options specified by the user */
|
||||||
static AVInputFormat *file_iformat;
|
static AVInputFormat *file_iformat;
|
||||||
@@ -1779,8 +1779,10 @@ static int video_thread(void *arg)
|
|||||||
|
|
||||||
if (ret < 0) goto the_end;
|
if (ret < 0) goto the_end;
|
||||||
|
|
||||||
|
#if CONFIG_AVFILTER
|
||||||
if (!picref)
|
if (!picref)
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
pts = pts_int*av_q2d(is->video_st->time_base);
|
pts = pts_int*av_q2d(is->video_st->time_base);
|
||||||
|
|
||||||
@@ -2950,7 +2952,7 @@ static void show_usage(void)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_help(void)
|
static int opt_help(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
av_log_set_callback(log_callback_help);
|
av_log_set_callback(log_callback_help);
|
||||||
show_usage();
|
show_usage();
|
||||||
@@ -2982,6 +2984,7 @@ static void show_help(void)
|
|||||||
"down/up seek backward/forward 1 minute\n"
|
"down/up seek backward/forward 1 minute\n"
|
||||||
"mouse click seek to percentage in file corresponding to fraction of width\n"
|
"mouse click seek to percentage in file corresponding to fraction of width\n"
|
||||||
);
|
);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called from the main */
|
/* Called from the main */
|
||||||
|
@@ -353,7 +353,7 @@ static int opt_input_file(const char *opt, const char *arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_help(void)
|
static int opt_help(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
av_log_set_callback(log_callback_help);
|
av_log_set_callback(log_callback_help);
|
||||||
show_usage();
|
show_usage();
|
||||||
@@ -361,6 +361,7 @@ static void show_help(void)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
av_opt_show2(avformat_opts, NULL,
|
av_opt_show2(avformat_opts, NULL,
|
||||||
AV_OPT_FLAG_DECODING_PARAM, 0);
|
AV_OPT_FLAG_DECODING_PARAM, 0);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void opt_pretty(void)
|
static void opt_pretty(void)
|
||||||
|
@@ -4662,12 +4662,13 @@ static void opt_debug(void)
|
|||||||
logfilename[0] = '-';
|
logfilename[0] = '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_help(void)
|
static int opt_help(const char *opt, const char *arg)
|
||||||
{
|
{
|
||||||
printf("usage: ffserver [options]\n"
|
printf("usage: ffserver [options]\n"
|
||||||
"Hyper fast multi format Audio/Video streaming server\n");
|
"Hyper fast multi format Audio/Video streaming server\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
show_help_options(options, "Main options:\n", 0, 0);
|
show_help_options(options, "Main options:\n", 0, 0);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const OptionDef options[] = {
|
static const OptionDef options[] = {
|
||||||
|
@@ -125,6 +125,8 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
|
|||||||
level_code = get_ue_code(gb,r->golomb_order);
|
level_code = get_ue_code(gb,r->golomb_order);
|
||||||
if(level_code >= ESCAPE_CODE) {
|
if(level_code >= ESCAPE_CODE) {
|
||||||
run = ((level_code - ESCAPE_CODE) >> 1) + 1;
|
run = ((level_code - ESCAPE_CODE) >> 1) + 1;
|
||||||
|
if(run > 64)
|
||||||
|
return -1;
|
||||||
esc_code = get_ue_code(gb,esc_golomb_order);
|
esc_code = get_ue_code(gb,esc_golomb_order);
|
||||||
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
|
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
|
||||||
while(level > r->inc_limit)
|
while(level > r->inc_limit)
|
||||||
@@ -164,7 +166,7 @@ static inline int decode_residual_inter(AVSContext *h) {
|
|||||||
|
|
||||||
/* get coded block pattern */
|
/* get coded block pattern */
|
||||||
int cbp= get_ue_golomb(&h->s.gb);
|
int cbp= get_ue_golomb(&h->s.gb);
|
||||||
if(cbp > 63){
|
if(cbp > 63U){
|
||||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
|
av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -190,7 +192,8 @@ static inline int decode_residual_inter(AVSContext *h) {
|
|||||||
|
|
||||||
static int decode_mb_i(AVSContext *h, int cbp_code) {
|
static int decode_mb_i(AVSContext *h, int cbp_code) {
|
||||||
GetBitContext *gb = &h->s.gb;
|
GetBitContext *gb = &h->s.gb;
|
||||||
int block, pred_mode_uv;
|
unsigned pred_mode_uv;
|
||||||
|
int block;
|
||||||
uint8_t top[18];
|
uint8_t top[18];
|
||||||
uint8_t *left = NULL;
|
uint8_t *left = NULL;
|
||||||
uint8_t *d;
|
uint8_t *d;
|
||||||
@@ -223,7 +226,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
|
|||||||
/* get coded block pattern */
|
/* get coded block pattern */
|
||||||
if(h->pic_type == AV_PICTURE_TYPE_I)
|
if(h->pic_type == AV_PICTURE_TYPE_I)
|
||||||
cbp_code = get_ue_golomb(gb);
|
cbp_code = get_ue_golomb(gb);
|
||||||
if(cbp_code > 63){
|
if(cbp_code > 63U){
|
||||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
|
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -446,6 +449,8 @@ static inline int check_for_slice(AVSContext *h) {
|
|||||||
if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
|
if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
|
||||||
skip_bits_long(gb,24+align);
|
skip_bits_long(gb,24+align);
|
||||||
h->stc = get_bits(gb,8);
|
h->stc = get_bits(gb,8);
|
||||||
|
if (h->stc >= h->mb_height)
|
||||||
|
return 0;
|
||||||
decode_slice_header(h,gb);
|
decode_slice_header(h,gb);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -660,7 +665,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
|
|||||||
buf_end = buf + buf_size;
|
buf_end = buf + buf_size;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
|
buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
|
||||||
if(stc & 0xFFFFFE00)
|
if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
|
||||||
return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
|
return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
|
||||||
input_size = (buf_end - buf_ptr)*8;
|
input_size = (buf_end - buf_ptr)*8;
|
||||||
switch(stc) {
|
switch(stc) {
|
||||||
|
@@ -380,7 +380,7 @@ uint64_t time= rdtsc();
|
|||||||
|
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
if(s->divx_packed && s->xvid_build>=0 && s->bitstream_buffer_size){
|
if(s->divx_packed && s->bitstream_buffer_size){
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<buf_size-3; i++){
|
for(i=0; i<buf_size-3; i++){
|
||||||
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){
|
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){
|
||||||
@@ -689,7 +689,7 @@ frame_end:
|
|||||||
int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
|
int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
|
||||||
int startcode_found=0;
|
int startcode_found=0;
|
||||||
|
|
||||||
if(buf_size - current_pos > 5){
|
if(buf_size - current_pos > 7){
|
||||||
int i;
|
int i;
|
||||||
for(i=current_pos; i<buf_size-4; i++){
|
for(i=current_pos; i<buf_size-4; i++){
|
||||||
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
|
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
|
||||||
|
@@ -881,14 +881,19 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->restart_interval && show_bits(&s->gb, 8) == 0xFF){/* skip RSTn */
|
if (s->restart_interval) --s->restart_count;
|
||||||
--s->restart_count;
|
i= 8+((-get_bits_count(&s->gb))&7);
|
||||||
|
if (s->restart_interval && show_bits(&s->gb, i) == (1<<i)-1){ /* skip RSTn */
|
||||||
|
int pos= get_bits_count(&s->gb);
|
||||||
align_get_bits(&s->gb);
|
align_get_bits(&s->gb);
|
||||||
while(show_bits(&s->gb, 8) == 0xFF)
|
while(show_bits(&s->gb, 8) == 0xFF)
|
||||||
skip_bits(&s->gb, 8);
|
skip_bits(&s->gb, 8);
|
||||||
skip_bits(&s->gb, 8);
|
if((get_bits(&s->gb, 8)&0xF8) == 0xD0){
|
||||||
for (i=0; i<nb_components; i++) /* reset dc */
|
for (i=0; i<nb_components; i++) /* reset dc */
|
||||||
s->last_dc[i] = 1024;
|
s->last_dc[i] = 1024;
|
||||||
|
}else{
|
||||||
|
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -345,8 +345,8 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
|
|||||||
|
|
||||||
#define DEFINE_LUT_FILTER(name_, description_, init_) \
|
#define DEFINE_LUT_FILTER(name_, description_, init_) \
|
||||||
AVFilter avfilter_vf_##name_ = { \
|
AVFilter avfilter_vf_##name_ = { \
|
||||||
.name = NULL_IF_CONFIG_SMALL(#name_), \
|
.name = #name_, \
|
||||||
.description = description_, \
|
.description = NULL_IF_CONFIG_SMALL(description_), \
|
||||||
.priv_size = sizeof(LutContext), \
|
.priv_size = sizeof(LutContext), \
|
||||||
\
|
\
|
||||||
.init = init_, \
|
.init = init_, \
|
||||||
|
@@ -232,6 +232,11 @@ static int config_props(AVFilterLink *outlink)
|
|||||||
if (!scale->sws)
|
if (!scale->sws)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
|
if (inlink->sample_aspect_ratio.num){
|
||||||
|
outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, inlink->sample_aspect_ratio);
|
||||||
|
} else
|
||||||
|
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@@ -233,8 +233,14 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
|
|||||||
|
|
||||||
int cur_len = start_off + len_off - off;
|
int cur_len = start_off + len_off - off;
|
||||||
int prev_len = out_len;
|
int prev_len = out_len;
|
||||||
|
void *newbuf;
|
||||||
out_len += cur_len;
|
out_len += cur_len;
|
||||||
asf->buf = av_realloc(asf->buf, out_len);
|
if(FFMIN(cur_len, len - off)<0)
|
||||||
|
return -1;
|
||||||
|
newbuf = av_realloc(asf->buf, out_len);
|
||||||
|
if(!newbuf)
|
||||||
|
return -1;
|
||||||
|
asf->buf= newbuf;
|
||||||
memcpy(asf->buf + prev_len, buf + off,
|
memcpy(asf->buf + prev_len, buf + off,
|
||||||
FFMIN(cur_len, len - off));
|
FFMIN(cur_len, len - off));
|
||||||
avio_skip(pb, cur_len);
|
avio_skip(pb, cur_len);
|
||||||
|
@@ -537,7 +537,8 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
|
|||||||
else
|
else
|
||||||
ic->pb = pb;
|
ic->pb = pb;
|
||||||
|
|
||||||
err = avformat_open_input(&ic, filename, fmt, &opts);
|
if ((err = avformat_open_input(&ic, filename, fmt, &opts)) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
*ic_ptr = ic;
|
*ic_ptr = ic;
|
||||||
ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above
|
ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above
|
||||||
@@ -595,13 +596,19 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
|
|||||||
probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) {
|
probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) {
|
||||||
int ret, score = probe_size < max_probe_size ? AVPROBE_SCORE_MAX/4 : 0;
|
int ret, score = probe_size < max_probe_size ? AVPROBE_SCORE_MAX/4 : 0;
|
||||||
int buf_offset = (probe_size == PROBE_BUF_MIN) ? 0 : probe_size>>1;
|
int buf_offset = (probe_size == PROBE_BUF_MIN) ? 0 : probe_size>>1;
|
||||||
|
void *buftmp;
|
||||||
|
|
||||||
if (probe_size < offset) {
|
if (probe_size < offset) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read probe data */
|
/* read probe data */
|
||||||
buf = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE);
|
buftmp = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE);
|
||||||
|
if(!buftmp){
|
||||||
|
av_free(buf);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
buf=buftmp;
|
||||||
if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) {
|
if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) {
|
||||||
/* fail if error was not end of file, otherwise, lower score */
|
/* fail if error was not end of file, otherwise, lower score */
|
||||||
if (ret != AVERROR_EOF) {
|
if (ret != AVERROR_EOF) {
|
||||||
|
Reference in New Issue
Block a user