inet_aton
inline_asm
isatty
+ kbhit
ldbrx
+ libdc1394_1
+ libdc1394_2
llrint
llrintf
local_aligned_16
# these are off by default, so fail if requested and not available
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
+enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0
enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
- enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
enabled libdirac && require_pkg_config dirac \
"libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h" \
"dirac_decoder_init dirac_encoder_init"
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
+ # libdc1394 check
+ if enabled libdc1394; then
+ { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
+ enable libdc1394_2; } ||
+ { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
+ enable libdc1394_1; } ||
+ die "ERROR: No version of libdc1394 found "
+ fi
+
+SDL_CONFIG="${cross_prefix}sdl-config"
if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
enable sdl &&
/* zero MV */
pred_count++;
- if (!fixed[mb_xy]) {
++ if (!fixed[mb_xy] && 0) {
+ if (s->avctx->codec_id == CODEC_ID_H264) {
+ // FIXME
+ } else {
+ ff_thread_await_progress((AVFrame *) s->last_picture_ptr,
+ mb_y, 0);
+ }
+ prev_x = s->last_picture.motion_val[0][mot_index][0];
+ prev_y = s->last_picture.motion_val[0][mot_index][1];
+ prev_ref = s->last_picture.ref_index[0][4*mb_xy];
+ } else {
+ prev_x = s->current_picture.motion_val[0][mot_index][0];
+ prev_y = s->current_picture.motion_val[0][mot_index][1];
+ prev_ref = s->current_picture.ref_index[0][4*mb_xy];
+ }
+
/* last MV */
- mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index][0];
- mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index][1];
- ref [pred_count] = s->current_picture.ref_index[0][4*mb_xy];
+ mv_predictor[pred_count][0]= prev_x;
+ mv_predictor[pred_count][1]= prev_y;
+ ref [pred_count] = prev_ref;
+ pred_count++;
s->mv_dir = MV_DIR_FORWARD;
s->mb_intra=0;
uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
+ if (s->avctx->codec_id == CODEC_ID_H264) {
+ // FIXME
+ } else {
+ ff_thread_await_progress((AVFrame *) s->last_picture_ptr,
+ mb_y, 0);
+ }
is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
+ // FIXME need await_progress() here
is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16);
}else{
if(IS_INTRA(s->current_picture.mb_type[mb_xy]))
return 0;
}
++
#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b)+(size))))
static void copy_picture_range(Picture **to, Picture **from, int count, MpegEncContext *new_base, MpegEncContext *old_base)
{
buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
if (start_code > 0x1ff){
if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT){
- if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){
+ if(HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)){
int i;
+ assert(avctx->thread_count > 1);
avctx->execute(avctx, slice_decode_thread, &s2->thread_context[0], NULL, s->slice_count, sizeof(void*));
for(i=0; i<s->slice_count; i++)
break;
}
- if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){
+ if(HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)){
int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;
+ assert(avctx->thread_count > 1);
if(threshold <= mb_y){
MpegEncContext *thread_context= s2->thread_context[s->slice_count];
return -1;
}
- if(s->avctx->active_thread_type&FF_THREAD_SLICE &&
++
+ if((s->avctx->active_thread_type & FF_THREAD_SLICE) &&
(s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height))){
av_log(s->avctx, AV_LOG_ERROR, "too many threads\n");
return -1;
if(init_duplicate_context(s, s) < 0) goto fail;
s->start_mb_y = 0;
s->end_mb_y = s->mb_height;
- }
++
}
return 0;
}
if ((stages > 0) && (level >= 4)) {
- #ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",stages,level);
- #endif
- av_dlog(s->avctx,
++ av_dlog(NULL,
+ "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",
+ stages, level);
return -1; /* invalid vector */
}
if (stages == -1) continue; /* skip vector */
if ((stages > 0) && (level >= 4)) {
- #ifdef DEBUG_SVQ1
- av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",stages,level);
- #endif
- av_dlog(s->avctx,
++ av_dlog(NULL,
+ "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",
+ stages, level);
return -1; /* invalid vector */
}
csub = (1 << cbits) - 1;
cval = 0;
- AV_DEBUG("Cbits %u\n", cbits);
+ av_dlog(NULL, "Cbits %u\n", cbits);
if (cbits) // this reads all subclasses for this partition's class
- cval = get_vlc2(gb, vc->codebooks[vf->class_masterbook[class]].vlc.table,
- vc->codebooks[vf->class_masterbook[class]].nb_bits, 3);
+ cval = get_vlc2(gb, vc->codebooks[vf->class_masterbook[partition_class]].vlc.table,
+ vc->codebooks[vf->class_masterbook[partition_class]].nb_bits, 3);
for (j = 0; j < cdim; ++j) {
- book = vf->subclass_books[class][cval & csub];
+ book = vf->subclass_books[partition_class][cval & csub];
- AV_DEBUG("book %d Cbits %u cval %u bits:%d\n",
- book, cbits, cval, get_bits_count(gb));
+ av_dlog(NULL, "book %d Cbits %u cval %u bits:%d\n",
+ book, cbits, cval, get_bits_count(gb));
cval = cval >> cbits;
if (book > -1) {
#include "libavutil/log.h"
#include "libavutil/opt.h"
-#include "libavformat/avformat.h"
+#include "avdevice.h"
-
- #undef DV1394_DEBUG
-
#include "libavformat/dv.h"
#include "dv1394.h"
#include <time.h>
#include <linux/fb.h>
+ #include "libavutil/log.h"
#include "libavutil/mem.h"
+ #include "libavutil/opt.h"
+ #include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
-#include "libavformat/avformat.h"
+#include "avdevice.h"
struct rgb_pixfmt_map_entry {
int bits_per_pixel;
fbdev->time_frame = av_gettime();
/* wait based on the frame rate */
- curtime = av_gettime();
- delay = fbdev->time_frame - curtime;
- av_dlog(avctx,
- "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
- fbdev->time_frame, curtime, delay);
- if (delay > 0) {
+ while (1) {
+ curtime = av_gettime();
+ delay = fbdev->time_frame - curtime;
+ av_dlog(avctx,
+ "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
+ fbdev->time_frame, curtime, delay);
+ if (delay <= 0) {
- fbdev->time_frame += INT64_C(1000000) * av_q2d(fbdev->time_base);
++ fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->fps);
+ break;
+ }
if (avctx->flags & AVFMT_FLAG_NONBLOCK)
return AVERROR(EAGAIN);
ts.tv_sec = delay / 1000000;
* IIDC1394 grab interface (uses libdc1394 and libraw1394)
* Copyright (c) 2004 Roman Shaposhnik
* Copyright (c) 2008 Alessandro Sappia
- * Copyright (c) 2011 Martin Lambers
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
{
struct video_data *s = s1->priv_data;
- struct v4l2_input input;
- struct v4l2_standard standard;
- struct v4l2_streamparm streamparm = { 0 };
+ struct v4l2_input input = {0};
+ struct v4l2_standard standard = {0};
+ struct v4l2_streamparm streamparm = {0};
struct v4l2_fract *tpf = &streamparm.parm.capture.timeperframe;
int i, ret;
+ AVRational fps;
streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
#define OFFSET(x) offsetof(struct video_data, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM
+
static const AVOption options[] = {
- { "standard", "", offsetof(struct video_data, standard), FF_OPT_TYPE_STRING, {.str = "NTSC" }, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
- { "channel", "", offsetof(struct video_data, channel), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { "standard", "", OFFSET(standard), FF_OPT_TYPE_STRING, {.str = NULL }, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
+ { "channel", "", OFFSET(channel), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+ { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ NULL },
};
#include "libavutil/parseutils.h"
#include <windows.h>
#include <vfw.h>
+#include "avdevice.h"
- //#define DEBUG_VFW
-
/* Defines for VFW missing from MinGW.
* Remove this when MinGW incorporates them. */
#define HWND_MESSAGE ((HWND)-3)
}
}while (!complete);
-- av_dlog(s, "ogg_packet: idx %i, frame size %i, start %i\n",
- idx, os->psize, os->pstart);
- idx, os->psize, os->pstart);
if (os->granule == -1)
av_log(s, AV_LOG_WARNING, "Page at %"PRId64" is missing granule\n", os->page_pos);