summaryrefslogtreecommitdiffstats
path: root/libvo/vo_dxr3.c
diff options
context:
space:
mode:
authormswitch <mswitch@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-19 15:08:15 +0000
committermswitch <mswitch@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-03-19 15:08:15 +0000
commit2a325840ddd11a152de2528b0655a6e518741fa1 (patch)
treec38240b9f8f7d381195edc7185eb4baf6d8d1b0b /libvo/vo_dxr3.c
parentee8f3bc33ddea3c535fc7d62b0ab7a7430fefba4 (diff)
downloadmpv-2a325840ddd11a152de2528b0655a6e518741fa1.tar.bz2
mpv-2a325840ddd11a152de2528b0655a6e518741fa1.tar.xz
Automatically use avcodec if it exists, otherwise fall back to fame (due
to some unresolved problems with fame) Bitrate is set to a constant 6e6 Fixed a bug occuring with round() Fixed a little #elif bug that would cause compilation to fail when not compiling with avcodec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5200 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_dxr3.c')
-rw-r--r--libvo/vo_dxr3.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libvo/vo_dxr3.c b/libvo/vo_dxr3.c
index d2d5213ae9..8dd07b367e 100644
--- a/libvo/vo_dxr3.c
+++ b/libvo/vo_dxr3.c
@@ -75,6 +75,11 @@
#include "../postproc/rgb2rgb.h"
#include "../postproc/swscale.h"
+#ifndef USE_LIBAVCODEC
+# define USE_LIBFAME
+#else
+# undef USE_LIBFAME
+#endif
#ifdef USE_LIBFAME
#include "../libfame/fame.h"
static unsigned char *outbuf = NULL;
@@ -276,10 +281,10 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
fame_params.width = s_width;
fame_params.height = s_height;
fame_params.coding = "I";
- fame_params.quality = 100;
- fame_params.bitrate = 0;
+ fame_params.quality = 90;
+ fame_params.bitrate = 6e6;
fame_params.slices_per_frame = 1;
- fame_params.frames_per_sequence = (int) round(vo_fps);
+ fame_params.frames_per_sequence = (int) (vo_fps + 0.5);
fame_params.shape_quality = 100;
fame_params.search_range = 8;
fame_params.verbose = 0;
@@ -337,7 +342,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
avc_context->gop_size = 15;
}
avc_context->frame_rate = (int) vo_fps * FRAME_RATE_BASE;
- avc_context->bit_rate = 8e6;
+ avc_context->bit_rate = 6e6;
avc_context->flags = CODEC_FLAG_HQ | CODEC_FLAG_QSCALE;
avc_context->quality = 2;
avc_context->pix_fmt = PIX_FMT_YUV420P;
@@ -423,7 +428,7 @@ static uint32_t draw_frame(uint8_t * src[])
#ifdef USE_LIBFAME
size = fame_encode_frame(fame_ctx, &fame_yuv, NULL);
write(fd_video, outbuf, size);
-#else USE_LIBAVCODEC
+#elif USE_LIBAVCODEC
size = avcodec_encode_video(avc_context, picture_data[0], avc_outbuf_size, &avc_picture);
write(fd_video, picture_data[0], size);
#endif
@@ -499,7 +504,7 @@ static uint32_t preinit(const char *arg)
int fdflags = O_WRONLY;
#ifdef USE_LIBFAME
- printf("VO: [dxr3] You are using fame, due to a small problem I have to disable prebuffering\n");
+ printf("VO: [dxr3] Prebuffering is temporarily disabled\n");
noprebuf = 1;
#else
/* Open the control interface */