Mercurial > mplayer.hg
comparison libvo/vo_dxr3.c @ 5547:92329b5f6ff3
Some minor changes to the avcodec code.
(Michael, perhaps you could explain to me why avc_ctx->quality = 1 produces unwatachable output, and when using gop_size = 0 or 1 (intra) video will disappear after seeking)
author | mswitch |
---|---|
date | Wed, 10 Apr 2002 16:03:08 +0000 |
parents | 80c4e6e50f1e |
children | 5a2d49aa72c2 |
comparison
equal
deleted
inserted
replaced
5546:8ec12d5ba6c6 | 5547:92329b5f6ff3 |
---|---|
116 static AVCodec *avc_codec = NULL; | 116 static AVCodec *avc_codec = NULL; |
117 static AVCodecContext *avc_context = NULL; | 117 static AVCodecContext *avc_context = NULL; |
118 static AVPicture avc_picture; | 118 static AVPicture avc_picture; |
119 int avc_outbuf_size = 100000; | 119 int avc_outbuf_size = 100000; |
120 extern int avcodec_inited; | 120 extern int avcodec_inited; |
121 extern int motion_estimation_method; | |
121 #endif | 122 #endif |
122 | 123 |
123 char *picture_data[] = { NULL, NULL, NULL }; | 124 char *picture_data[] = { NULL, NULL, NULL }; |
124 int picture_linesize[] = { 0, 0, 0 }; | 125 int picture_linesize[] = { 0, 0, 0 }; |
125 | 126 |
399 avc_context = malloc(sizeof(AVCodecContext)); | 400 avc_context = malloc(sizeof(AVCodecContext)); |
400 memset(avc_context, 0, sizeof(AVCodecContext)); | 401 memset(avc_context, 0, sizeof(AVCodecContext)); |
401 avc_context->width = s_width; | 402 avc_context->width = s_width; |
402 avc_context->height = s_height; | 403 avc_context->height = s_height; |
403 ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &ioval); | 404 ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &ioval); |
404 if (ioval == EM8300_VIDEOMODE_NTSC) { | 405 avc_context->gop_size = 7; |
405 avc_context->gop_size = 18; | |
406 } else { | |
407 avc_context->gop_size = 15; | |
408 } | |
409 avc_context->frame_rate = (int) (vo_fps * FRAME_RATE_BASE); | 406 avc_context->frame_rate = (int) (vo_fps * FRAME_RATE_BASE); |
410 avc_context->bit_rate = 6e6; | 407 avc_context->bit_rate = 0; |
411 avc_context->flags = CODEC_FLAG_QSCALE; | 408 avc_context->flags = CODEC_FLAG_QSCALE; |
412 avc_context->quality = 2; | 409 avc_context->quality = 2; |
413 avc_context->pix_fmt = PIX_FMT_YUV420P; | 410 avc_context->pix_fmt = PIX_FMT_YUV420P; |
411 motion_estimation_method = ME_EPZS; | |
414 if (avcodec_open(avc_context, avc_codec) < 0) { | 412 if (avcodec_open(avc_context, avc_codec) < 0) { |
415 printf("VO: [dxr3] Unable to open codec\n"); | 413 printf("VO: [dxr3] Unable to open codec\n"); |
416 uninit(); | 414 uninit(); |
417 return -1; | 415 return -1; |
418 } | 416 } |