mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavc: Deprecate the deinterlace functions in libavcodec h264: Integrate draw_horiz_band into ff_h264_draw_horiz_band Conflicts: configure ffmpeg_opt.c libavcodec/avcodec.h libavcodec/h264.c libavcodec/imgconvert.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
8cc5481d51
4
ffmpeg.c
4
ffmpeg.c
@ -681,6 +681,7 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FF_API_DEINTERLACE
|
||||||
static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)
|
static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp)
|
||||||
{
|
{
|
||||||
AVCodecContext *dec;
|
AVCodecContext *dec;
|
||||||
@ -721,6 +722,7 @@ static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void *
|
|||||||
*picture = *picture2;
|
*picture = *picture2;
|
||||||
*bufp = buf;
|
*bufp = buf;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void do_subtitle_out(AVFormatContext *s,
|
static void do_subtitle_out(AVFormatContext *s,
|
||||||
OutputStream *ost,
|
OutputStream *ost,
|
||||||
@ -1675,7 +1677,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkt->size = 0;
|
pkt->size = 0;
|
||||||
|
#if FF_API_DEINTERLACE
|
||||||
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
|
pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free);
|
||||||
|
#endif
|
||||||
|
|
||||||
rate_emu_sleep(ist);
|
rate_emu_sleep(ist);
|
||||||
|
|
||||||
|
@ -4616,14 +4616,16 @@ int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
|
|||||||
*/
|
*/
|
||||||
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
|
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
|
||||||
|
|
||||||
|
#if FF_API_DEINTERLACE
|
||||||
/**
|
/**
|
||||||
* deinterlace - if not supported return -1
|
* deinterlace - if not supported return -1
|
||||||
*
|
*
|
||||||
* @deprecated - use yadif (in lavfilter) instead
|
* @deprecated - use yadif (in libavfilter) instead
|
||||||
*/
|
*/
|
||||||
attribute_deprecated
|
attribute_deprecated
|
||||||
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
|
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
|
||||||
enum AVPixelFormat pix_fmt, int width, int height);
|
enum AVPixelFormat pix_fmt, int width, int height);
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* Copy image src to dst. Wraps av_image_copy().
|
* Copy image src to dst. Wraps av_image_copy().
|
||||||
*/
|
*/
|
||||||
|
@ -143,28 +143,30 @@ static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
|
|||||||
ff_h264_hl_decode_mb(h);
|
ff_h264_hl_decode_mb(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_horiz_band(AVCodecContext *avctx, Picture *cur,
|
void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
|
||||||
Picture *last, int y, int h, int picture_structure,
|
|
||||||
int first_field, int low_delay)
|
|
||||||
{
|
{
|
||||||
|
AVCodecContext *avctx = h->avctx;
|
||||||
|
Picture *cur = &h->cur_pic;
|
||||||
|
Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL;
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||||
int vshift = desc->log2_chroma_h;
|
int vshift = desc->log2_chroma_h;
|
||||||
const int field_pic = picture_structure != PICT_FRAME;
|
const int field_pic = h->picture_structure != PICT_FRAME;
|
||||||
if (field_pic) {
|
if (field_pic) {
|
||||||
h <<= 1;
|
height <<= 1;
|
||||||
y <<= 1;
|
y <<= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
h = FFMIN(h, avctx->height - y);
|
height = FFMIN(height, avctx->height - y);
|
||||||
|
|
||||||
if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
|
if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
|
||||||
|
return;
|
||||||
|
|
||||||
if (avctx->draw_horiz_band) {
|
if (avctx->draw_horiz_band) {
|
||||||
AVFrame *src;
|
AVFrame *src;
|
||||||
int offset[AV_NUM_DATA_POINTERS];
|
int offset[AV_NUM_DATA_POINTERS];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(cur->f.pict_type == AV_PICTURE_TYPE_B || low_delay ||
|
if (cur->f.pict_type == AV_PICTURE_TYPE_B || h->low_delay ||
|
||||||
(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
|
(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
|
||||||
src = &cur->f;
|
src = &cur->f;
|
||||||
else if (last)
|
else if (last)
|
||||||
@ -181,18 +183,10 @@ static void draw_horiz_band(AVCodecContext *avctx, Picture *cur,
|
|||||||
emms_c();
|
emms_c();
|
||||||
|
|
||||||
avctx->draw_horiz_band(avctx, src, offset,
|
avctx->draw_horiz_band(avctx, src, offset,
|
||||||
y, picture_structure, h);
|
y, h->picture_structure, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_draw_horiz_band(H264Context *h, int y, int height)
|
|
||||||
{
|
|
||||||
draw_horiz_band(h->avctx, &h->cur_pic,
|
|
||||||
h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL,
|
|
||||||
y, height, h->picture_structure, h->first_field,
|
|
||||||
h->low_delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void free_frame_buffer(H264Context *h, Picture *pic)
|
static void free_frame_buffer(H264Context *h, Picture *pic)
|
||||||
{
|
{
|
||||||
pic->period_since_free = 0;
|
pic->period_since_free = 0;
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
#define FF_API_IDCT (LIBAVCODEC_VERSION_MAJOR < 55)
|
#define FF_API_IDCT (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||||
#endif
|
#endif
|
||||||
#ifndef FF_API_DEINTERLACE
|
#ifndef FF_API_DEINTERLACE
|
||||||
#define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 55)
|
#define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 56)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* AVCODEC_VERSION_H */
|
#endif /* AVCODEC_VERSION_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user