Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 655440
Collapse All | Expand All

(-)preff4/encode/encode_lavc.c (-9 / +9 lines)
Lines 240-246 Link Here
240
                                     vframe_list_t *vframe)
240
                                     vframe_list_t *vframe)
241
{
241
{
242
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf,
242
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf,
243
                    PIX_FMT_YUV420P,
243
                    AV_PIX_FMT_YUV420P,
244
                    pd->ff_vcontext.width, pd->ff_vcontext.height);
244
                    pd->ff_vcontext.width, pd->ff_vcontext.height);
245
}
245
}
246
246
Lines 254-260 Link Here
254
                    IMG_YUV_DEFAULT,
254
                    IMG_YUV_DEFAULT,
255
                    pd->ff_vcontext.width, pd->ff_vcontext.height);
255
                    pd->ff_vcontext.width, pd->ff_vcontext.height);
256
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
256
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
257
                   PIX_FMT_YUV422P,
257
                   AV_PIX_FMT_YUV422P,
258
                   pd->ff_vcontext.width, pd->ff_vcontext.height);
258
                   pd->ff_vcontext.width, pd->ff_vcontext.height);
259
    ac_imgconvert(src, IMG_YUV_DEFAULT,
259
    ac_imgconvert(src, IMG_YUV_DEFAULT,
260
                  pd->ff_venc_frame.data, IMG_YUV422P,
260
                  pd->ff_venc_frame.data, IMG_YUV422P,
Lines 270-276 Link Here
270
                    IMG_YUV422P,
270
                    IMG_YUV422P,
271
                    pd->ff_vcontext.width, pd->ff_vcontext.height);
271
                    pd->ff_vcontext.width, pd->ff_vcontext.height);
272
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
272
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
273
                   PIX_FMT_YUV420P,
273
                   AV_PIX_FMT_YUV420P,
274
                   pd->ff_vcontext.width, pd->ff_vcontext.height);
274
                   pd->ff_vcontext.width, pd->ff_vcontext.height);
275
    ac_imgconvert(src, IMG_YUV422P,
275
    ac_imgconvert(src, IMG_YUV422P,
276
                  pd->ff_venc_frame.data, IMG_YUV420P,
276
                  pd->ff_venc_frame.data, IMG_YUV420P,
Lines 292-298 Link Here
292
                                   vframe_list_t *vframe)
292
                                   vframe_list_t *vframe)
293
{
293
{
294
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
294
    avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf,
295
                   PIX_FMT_YUV420P,
295
                   AV_PIX_FMT_YUV420P,
296
                   pd->ff_vcontext.width, pd->ff_vcontext.height);
296
                   pd->ff_vcontext.width, pd->ff_vcontext.height);
297
    ac_imgconvert(&vframe->video_buf, IMG_RGB_DEFAULT,
297
    ac_imgconvert(&vframe->video_buf, IMG_RGB_DEFAULT,
298
                  pd->ff_venc_frame.data, IMG_YUV420P,
298
                  pd->ff_venc_frame.data, IMG_YUV420P,
Lines 622-636 Link Here
622
        } else {
622
        } else {
623
            pd->tc_pix_fmt = TC_CODEC_YUV420P;
623
            pd->tc_pix_fmt = TC_CODEC_YUV420P;
624
            pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) 
624
            pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) 
625
                                       ? PIX_FMT_YUVJ420P
625
                                       ? AV_PIX_FMT_YUVJ420P
626
                                       : PIX_FMT_YUV420P;
626
                                       : AV_PIX_FMT_YUV420P;
627
            pd->pre_encode_video = pre_encode_video_yuv420p;
627
            pd->pre_encode_video = pre_encode_video_yuv420p;
628
        }
628
        }
629
        break;
629
        break;
630
      case CODEC_YUV422:
630
      case CODEC_YUV422:
631
        pd->tc_pix_fmt = TC_CODEC_YUV422P;
631
        pd->tc_pix_fmt = TC_CODEC_YUV422P;
632
        pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) 
632
        pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) 
633
                                   ? PIX_FMT_YUVJ422P
633
                                   ? AV_PIX_FMT_YUVJ422P
634
                                   : PIX_FMT_YUV422P;
634
                                   : PIX_FMT_YUV422P;
635
        if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) {
635
        if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) {
636
            pd->pre_encode_video = pre_encode_video_yuv422p_huffyuv;
636
            pd->pre_encode_video = pre_encode_video_yuv422p_huffyuv;
Lines 643-650 Link Here
643
        pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV)
643
        pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV)
644
                                        ? PIX_FMT_YUV422P
644
                                        ? PIX_FMT_YUV422P
645
                                        : (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) 
645
                                        : (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) 
646
                                           ? PIX_FMT_YUVJ420P
646
                                           ? AV_PIX_FMT_YUVJ420P
647
                                           : PIX_FMT_YUV420P;
647
                                           : AV_PIX_FMT_YUV420P;
648
        pd->pre_encode_video = pre_encode_video_rgb24;
648
        pd->pre_encode_video = pre_encode_video_rgb24;
649
        break;
649
        break;
650
      default:
650
      default:
(-)preff4/export/export_ffmpeg.c (-9 / +9 lines)
Lines 490-496 Link Here
490
    lavc_venc_frame   = avcodec_alloc_frame();
490
    lavc_venc_frame   = avcodec_alloc_frame();
491
491
492
    lavc_convert_frame= avcodec_alloc_frame();
492
    lavc_convert_frame= avcodec_alloc_frame();
493
    size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
493
    size = avpicture_get_size(AV_PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
494
    enc_buffer = tc_malloc(size);
494
    enc_buffer = tc_malloc(size);
495
495
496
    if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) {
496
    if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) {
Lines 1118-1124 Link Here
1118
    lavc_venc_context->prediction_method = lavc_param_prediction_method;
1118
    lavc_venc_context->prediction_method = lavc_param_prediction_method;
1119
1119
1120
    if(is_huffyuv)
1120
    if(is_huffyuv)
1121
        lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
1121
        lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P;
1122
    else
1122
    else
1123
    {
1123
    {
1124
        switch(pix_fmt)
1124
        switch(pix_fmt)
Lines 1127-1144 Link Here
1127
            case CODEC_RGB:
1127
            case CODEC_RGB:
1128
            {
1128
            {
1129
                if(is_mjpeg)
1129
                if(is_mjpeg)
1130
                    lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P;
1130
                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ420P;
1131
                else
1131
                else
1132
                    lavc_venc_context->pix_fmt = PIX_FMT_YUV420P;
1132
                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV420P;
1133
                break;
1133
                break;
1134
            }
1134
            }
1135
1135
1136
            case CODEC_YUV422:
1136
            case CODEC_YUV422:
1137
            {
1137
            {
1138
                if(is_mjpeg)
1138
                if(is_mjpeg)
1139
                    lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P;
1139
                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ422P;
1140
                else
1140
                else
1141
                    lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
1141
                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P;
1142
                break;
1142
                break;
1143
            }
1143
            }
1144
1144
Lines 1623-1629 Link Here
1623
	        	YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT,
1623
	        	YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT,
1624
			                	lavc_venc_context->width, lavc_venc_context->height);
1624
			                	lavc_venc_context->width, lavc_venc_context->height);
1625
                avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
1625
                avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
1626
                               PIX_FMT_YUV422P, lavc_venc_context->width,
1626
                               AV_PIX_FMT_YUV422P, lavc_venc_context->width,
1627
                               lavc_venc_context->height);
1627
                               lavc_venc_context->height);
1628
        		/* FIXME: can't use tcv_convert (see decode_lavc.c) */
1628
        		/* FIXME: can't use tcv_convert (see decode_lavc.c) */
1629
                ac_imgconvert(src, IMG_YUV_DEFAULT,
1629
                ac_imgconvert(src, IMG_YUV_DEFAULT,
Lines 1653-1659 Link Here
1653
		                		lavc_venc_context->width,
1653
		                		lavc_venc_context->width,
1654
                                lavc_venc_context->height);
1654
                                lavc_venc_context->height);
1655
                avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
1655
                avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
1656
                               PIX_FMT_YUV420P, lavc_venc_context->width,
1656
                               AV_PIX_FMT_YUV420P, lavc_venc_context->width,
1657
                               lavc_venc_context->height);
1657
                               lavc_venc_context->height);
1658
                ac_imgconvert(src, IMG_YUV422P,
1658
                ac_imgconvert(src, IMG_YUV422P,
1659
                              lavc_venc_frame->data, IMG_YUV420P,
1659
                              lavc_venc_frame->data, IMG_YUV420P,
Lines 1664-1670 Link Here
1664
1664
1665
        case CODEC_RGB:
1665
        case CODEC_RGB:
1666
            avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
1666
            avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
1667
                           PIX_FMT_YUV420P, lavc_venc_context->width,
1667
                           AV_PIX_FMT_YUV420P, lavc_venc_context->width,
1668
                           lavc_venc_context->height);
1668
                           lavc_venc_context->height);
1669
    	    ac_imgconvert(&param->buffer, IMG_RGB_DEFAULT,
1669
    	    ac_imgconvert(&param->buffer, IMG_RGB_DEFAULT,
1670
                              lavc_venc_frame->data, IMG_YUV420P,
1670
                              lavc_venc_frame->data, IMG_YUV420P,
(-)preff4/import/decode_lavc.c (-7 / +7 lines)
Lines 327-334 Link Here
327
327
328
      // Convert avcodec image to the requested YUV or RGB format
328
      // Convert avcodec image to the requested YUV or RGB format
329
      switch (lavc_dec_context->pix_fmt) {
329
      switch (lavc_dec_context->pix_fmt) {
330
	case PIX_FMT_YUVJ420P:
330
	case AV_PIX_FMT_YUVJ420P:
331
	case PIX_FMT_YUV420P:
331
	case AV_PIX_FMT_YUV420P:
332
	    // Remove "dead space" at right edge of planes, if any
332
	    // Remove "dead space" at right edge of planes, if any
333
	    if (picture.linesize[0] != lavc_dec_context->width) {
333
	    if (picture.linesize[0] != lavc_dec_context->width) {
334
		int y;
334
		int y;
Lines 352-358 Link Here
352
			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
352
			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
353
			  lavc_dec_context->width, lavc_dec_context->height);
353
			  lavc_dec_context->width, lavc_dec_context->height);
354
	    break;
354
	    break;
355
	case PIX_FMT_YUV411P:
355
	case AV_PIX_FMT_YUV411P:
356
	    if (picture.linesize[0] != lavc_dec_context->width) {
356
	    if (picture.linesize[0] != lavc_dec_context->width) {
357
		int y;
357
		int y;
358
		for (y = 0; y < lavc_dec_context->height; y++) {
358
		for (y = 0; y < lavc_dec_context->height; y++) {
Lines 371-378 Link Here
371
			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
371
			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
372
			  lavc_dec_context->width, lavc_dec_context->height);
372
			  lavc_dec_context->width, lavc_dec_context->height);
373
	    break;
373
	    break;
374
	case PIX_FMT_YUVJ422P:
374
	case AV_PIX_FMT_YUVJ422P:
375
	case PIX_FMT_YUV422P:
375
	case AV_PIX_FMT_YUV422P:
376
	    if (picture.linesize[0] != lavc_dec_context->width) {
376
	    if (picture.linesize[0] != lavc_dec_context->width) {
377
		int y;
377
		int y;
378
		for (y = 0; y < lavc_dec_context->height; y++) {
378
		for (y = 0; y < lavc_dec_context->height; y++) {
Lines 391-398 Link Here
391
			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
391
			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
392
			  lavc_dec_context->width, lavc_dec_context->height);
392
			  lavc_dec_context->width, lavc_dec_context->height);
393
	    break;
393
	    break;
394
	case PIX_FMT_YUVJ444P:
394
	case AV_PIX_FMT_YUVJ444P:
395
	case PIX_FMT_YUV444P:
395
	case AV_PIX_FMT_YUV444P:
396
	    if (picture.linesize[0] != lavc_dec_context->width) {
396
	    if (picture.linesize[0] != lavc_dec_context->width) {
397
		int y;
397
		int y;
398
		for (y = 0; y < lavc_dec_context->height; y++) {
398
		for (y = 0; y < lavc_dec_context->height; y++) {
(-)preff4/import/import_ffmpeg.c (-7 / +7 lines)
Lines 661-668 Link Here
661
661
662
    // Convert avcodec image to our internal YUV or RGB format
662
    // Convert avcodec image to our internal YUV or RGB format
663
    switch (lavc_dec_context->pix_fmt) {
663
    switch (lavc_dec_context->pix_fmt) {
664
      case PIX_FMT_YUVJ420P:
664
      case AV_PIX_FMT_YUVJ420P:
665
      case PIX_FMT_YUV420P:
665
      case AV_PIX_FMT_YUV420P:
666
        src_fmt = IMG_YUV420P;
666
        src_fmt = IMG_YUV420P;
667
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
667
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
668
                        lavc_dec_context->width, lavc_dec_context->height);
668
                        lavc_dec_context->width, lavc_dec_context->height);
Lines 693-699 Link Here
693
	}
693
	}
694
        break;
694
        break;
695
695
696
      case PIX_FMT_YUV411P:
696
      case AV_PIX_FMT_YUV411P:
697
        src_fmt = IMG_YUV411P;
697
        src_fmt = IMG_YUV411P;
698
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
698
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
699
                        lavc_dec_context->width, lavc_dec_context->height);
699
                        lavc_dec_context->width, lavc_dec_context->height);
Lines 721-728 Link Here
721
        }
721
        }
722
        break;
722
        break;
723
723
724
      case PIX_FMT_YUVJ422P:
724
      case AV_PIX_FMT_YUVJ422P:
725
      case PIX_FMT_YUV422P:
725
      case AV_PIX_FMT_YUV422P:
726
        src_fmt = IMG_YUV422P;
726
        src_fmt = IMG_YUV422P;
727
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
727
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
728
                        lavc_dec_context->width, lavc_dec_context->height);
728
                        lavc_dec_context->width, lavc_dec_context->height);
Lines 750-757 Link Here
750
        }
750
        }
751
	break;
751
	break;
752
752
753
      case PIX_FMT_YUVJ444P:
753
      case AV_PIX_FMT_YUVJ444P:
754
      case PIX_FMT_YUV444P:
754
      case AV_PIX_FMT_YUV444P:
755
        src_fmt = IMG_YUV444P;
755
        src_fmt = IMG_YUV444P;
756
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
756
        YUV_INIT_PLANES(src_planes, frame, src_fmt,
757
                        lavc_dec_context->width, lavc_dec_context->height);
757
                        lavc_dec_context->width, lavc_dec_context->height);

Return to bug 655440