--enable-libxavs enable AVS encoding via xavs [no]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
- --enable-mlib enable Sun medialib [no]
+ --enable-openal enable OpenAL 1.1 capture support [no]
--enable-openssl enable openssl [no]
--enable-zlib enable zlib [autodetect]
die "ERROR: libx264 version must be >= 0.118."; }
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
- enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
+enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
+ check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
+ die "ERROR: openal not found"; } &&
+ { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
+ die "ERROR: openal version must be 1.1 or compatible"; }
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
API changes, most recent first:
+2012-02-06 - xxxxxxx - lavu 51.38.100
+ Add av_parse_ratio() function to parseutils.h.
+
+2012-02-06 - xxxxxxx - lavu 51.38.100
+ Add AV_LOG_MAX_OFFSET macro to log.h.
+
+2012-02-02 - xxxxxxx - lavu 51.37.100
+ Add public timecode helpers.
+
+2012-01-24 - xxxxxxx - lavfi 2.60.100
+ Add avfilter_graph_dump.
+
+ 2012-02-xx - xxxxxxx - lavu 51.22.1 - pixdesc.h
+ Add PIX_FMT_PSEUDOPAL flag.
+
+ 2012-02-01 - xxxxxxx - lavc 54.01.0
+ Add avcodec_encode_video2() and deprecate avcodec_encode_video().
+
2012-02-01 - 316fc74 - lavc 54.01.0
Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
}
}
- static int bit_buffer_size = 1024 * 256;
- static uint8_t *bit_buffer = NULL;
-
-#if !CONFIG_AVFILTER
static void do_video_resample(OutputStream *ost,
InputStream *ist,
AVFrame *in_picture,
for (i = 0; i < nb_frames; i++) {
AVPacket pkt;
av_init_packet(&pkt);
+ pkt.data = NULL;
+ pkt.size = 0;
- if (!check_recording_time(ost))
- return;
-
if (s->oformat->flags & AVFMT_RAWPICTURE &&
enc->codec->id == CODEC_ID_RAWVIDEO) {
/* raw pictures are written as AVPicture structure to
exit_program(1);
}
- if (ret > 0) {
- pkt.data = bit_buffer;
- pkt.size = ret;
- if (!(enc->codec->capabilities & CODEC_CAP_DELAY))
- pkt.pts = av_rescale_q(ost->sync_opts, enc->time_base, ost->st->time_base);
- if (enc->coded_frame->pts != AV_NOPTS_VALUE)
- pkt.pts = av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
+ if (got_packet) {
++ if (pkt.pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & CODEC_CAP_DELAY))
++ pkt.pts = ost->sync_opts;
++
+ if (pkt.pts != AV_NOPTS_VALUE)
+ pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base);
+ if (pkt.dts != AV_NOPTS_VALUE)
+ pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
- if (enc->coded_frame->key_frame)
- pkt.flags |= AV_PKT_FLAG_KEY;
+ if (format_video_sync == VSYNC_DROP)
+ pkt.pts = pkt.dts = AV_NOPTS_VALUE;
++
write_frame(s, &pkt, ost);
-- *frame_size = ret;
-- video_size += ret;
++ *frame_size = pkt.size;
++ video_size += pkt.size;
/* if two pass, output log */
if (ost->logfile && enc->stats_out) {
av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n");
exit_program(1);
}
-- video_size += ret;
- if (enc->coded_frame && enc->coded_frame->key_frame)
- pkt.flags |= AV_PKT_FLAG_KEY;
++ video_size += pkt.size;
if (ost->logfile && enc->stats_out) {
fprintf(ost->logfile, "%s", enc->stats_out);
}
}
codec->stats_in = logbuffer;
}
+ if (codec->flags & CODEC_FLAG_PASS1) {
+ f = fopen(logfilename, "wb");
+ if (!f) {
+ av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n",
+ logfilename, strerror(errno));
+ exit_program(1);
+ }
+ ost->logfile = f;
+ }
}
}
- if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- /* maximum video buffer size is 8-bytes per pixel, plus DPX header size (1664)*/
- int size = codec->width * codec->height;
- bit_buffer_size = FFMAX(bit_buffer_size, 9*size + 10000);
- }
- }
-
- if (!bit_buffer)
- bit_buffer = av_malloc(bit_buffer_size);
- if (!bit_buffer) {
- av_log(NULL, AV_LOG_ERROR, "Cannot allocate %d bytes output buffer\n",
- bit_buffer_size);
- return AVERROR(ENOMEM);
}
/* open each encoder */
# thread libraries
OBJS-$(HAVE_PTHREADS) += pthread.o
OBJS-$(HAVE_W32THREADS) += pthread.o
+OBJS-$(HAVE_OS2THREADS) += pthread.o
- OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
-
# inverse.o contains the ff_inverse table definition, which is used by
# the FASTDIV macro (from libavutil); since referencing the external
# table has a negative effect on performance, copy it in libavcodec as
elem_id = get_bits(gb, 4);
if (elem_type < TYPE_DSE) {
- if (output_configure(ac, ac->che_pos, new_che_pos, 2, OC_TRIAL_FRAME)<0)
+ if (!ac->tags_mapped && elem_type == TYPE_CPE && ac->m4ac.chan_config==1) {
+ enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]= {0};
+ ac->m4ac.chan_config=2;
+
+ if (set_default_channel_config(ac->avctx, new_che_pos, 2)<0)
+ return -1;
++ if (output_configure(ac, new_che_pos, 2, OC_TRIAL_FRAME)<0)
+ return -1;
+ }
if (!(che=get_che(ac, elem_type, elem_id))) {
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
elem_type, elem_id);
if ((err = decode_pce(avctx, &ac->m4ac, new_che_pos, gb)))
break;
if (ac->output_configured > OC_TRIAL_PCE)
- av_log(avctx, AV_LOG_ERROR,
- "Not evaluating a further program_config_element as this construct is dubious at best.\n");
- else
- err = output_configure(ac, new_che_pos, 0, OC_TRIAL_PCE);
+ av_log(avctx, AV_LOG_INFO,
+ "Evaluating a further program_config_element.\n");
- err = output_configure(ac, ac->che_pos, new_che_pos, 0, OC_TRIAL_PCE);
++ err = output_configure(ac, new_che_pos, 0, OC_TRIAL_PCE);
+ if (!err)
+ ac->m4ac.chan_config = 0;
break;
}
p += nals[i].i_payload;
}
- return p - buf;
+ return 1;
}
- static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
- int orig_bufsize, void *data)
+static int avfmt2_num_planes(int avfmt)
+{
+ switch (avfmt) {
+ case PIX_FMT_YUV420P:
+ case PIX_FMT_YUVJ420P:
+ case PIX_FMT_YUV420P9:
+ case PIX_FMT_YUV420P10:
+ case PIX_FMT_YUV444P:
+ return 3;
+
+ case PIX_FMT_BGR24:
+ case PIX_FMT_RGB24:
+ return 1;
+
+ default:
+ return 3;
+ }
+}
+
+ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
+ int *got_packet)
{
X264Context *x4 = ctx->priv_data;
- AVFrame *frame = data;
x264_nal_t *nal;
- int nnal, i;
+ int nnal, i, ret;
x264_picture_t pic_out;
- int bufsize;
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
return -1;
}
- if(av_image_check_size(avctx->width, avctx->height, 0, avctx))
- return -1;
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){
- int ret = avctx->codec->encode(avctx, buf, buf_size, pict);
- avctx->frame_number++;
- emms_c(); //needed to avoid an emms_c() call before every return;
- return ret;
- }else
+ av_init_packet(&pkt);
+ pkt.data = buf;
+ pkt.size = buf_size;
+
+ ret = avcodec_encode_video2(avctx, &pkt, pict, &got_packet);
+ if (!ret && got_packet && avctx->coded_frame) {
+ avctx->coded_frame->pts = pkt.pts;
+ avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
+ }
+
+ /* free any side data since we cannot return it */
+ if (pkt.side_data_elems > 0) {
+ int i;
+ for (i = 0; i < pkt.side_data_elems; i++)
+ av_free(pkt.side_data[i].data);
+ av_freep(&pkt.side_data);
+ pkt.side_data_elems = 0;
+ }
+
+ return ret ? ret : pkt.size;
+ }
+ #endif
+
+ #define MAX_CODED_FRAME_SIZE(width, height)\
- (8*(width)*(height) + FF_MIN_BUFFER_SIZE)
++ (9*(width)*(height) + FF_MIN_BUFFER_SIZE)
+
+ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
+ AVPacket *avpkt,
+ const AVFrame *frame,
+ int *got_packet_ptr)
+ {
+ int ret;
+ int user_packet = !!avpkt->data;
+
+ if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
+ av_init_packet(avpkt);
+ avpkt->size = 0;
+ *got_packet_ptr = 0;
return 0;
- avpkt->flags |= AV_PKT_FLAG_KEY*avctx->coded_frame->key_frame;
+ }
+
+ if (av_image_check_size(avctx->width, avctx->height, 0, avctx))
+ return AVERROR(EINVAL);
+
+ if (avctx->codec->encode2) {
+ *got_packet_ptr = 0;
+ ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
+ if (!ret) {
+ if (!*got_packet_ptr)
+ avpkt->size = 0;
+ else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
+ avpkt->pts = avpkt->dts = frame->pts;
+ }
+ } else {
+ /* for compatibility with encoders not supporting encode2(), we need to
+ allocate a packet buffer if the user has not provided one or check
+ the size otherwise */
+ int buf_size = avpkt->size;
+
+ if (!user_packet)
+ buf_size = MAX_CODED_FRAME_SIZE(avctx->width, avctx->height);
+
+ if ((ret = ff_alloc_packet(avpkt, buf_size)))
+ return ret;
+
+ /* encode the frame */
+ ret = avctx->codec->encode(avctx, avpkt->data, avpkt->size, frame);
+ if (ret >= 0) {
+ if (!ret) {
+ /* no output. if the packet data was allocated by libavcodec,
+ free it */
+ if (!user_packet)
+ av_freep(&avpkt->data);
+ } else if (avctx->coded_frame) {
+ avpkt->pts = avctx->coded_frame->pts;
++ avpkt->flags |= AV_PKT_FLAG_KEY*!!avctx->coded_frame->key_frame;
+ }
+
+ avpkt->size = ret;
+ *got_packet_ptr = (ret > 0);
+ ret = 0;
+ }
+ }
+
+ if (!ret)
+ avctx->frame_number++;
+
+ emms_c();
+ return ret;
}
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name,
scale->flags);
- scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL;
+ scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL ||
+ av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PSEUDOPAL;
+ if (outfmt == PIX_FMT_PAL8) outfmt = PIX_FMT_BGR8;
if (scale->sws)
sws_freeContext(scale->sws);
*/
#define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 22
-#define LIBAVUTIL_VERSION_MICRO 1
+#define LIBAVUTIL_VERSION_MINOR 38
- #define LIBAVUTIL_VERSION_MICRO 100
++#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \