mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avcodec/thread: Move ff_thread_(await|report)_progress to new header
This is in preparation for further commits that will stop using ThreadFrame for frame-threaded codecs that don't use ff_thread_(await|report)_progress(); the API for those codecs having inter-frame depdendencies will live in threadframe.h. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
7fc10e273b
commit
b3551b6072
@ -34,7 +34,7 @@
|
||||
#include "mpegutils.h"
|
||||
#include "mpegvideo.h"
|
||||
#include "rectangle.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
/**
|
||||
* @param stride the number of MVs to get to the next row
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "golomb.h"
|
||||
#include "mathops.h"
|
||||
#include "ffv1.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
||||
int is_signed)
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "h264_ps.h"
|
||||
#include "mpegutils.h"
|
||||
#include "rectangle.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "h264dec.h"
|
||||
#include "h264_ps.h"
|
||||
#include "qpeldsp.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
static inline int get_lowest_part_list_y(H264SliceContext *sl,
|
||||
int n, int height, int y_offset, int list)
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "h264dec.h"
|
||||
#include "mpegutils.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
void ff_h264_unref_picture(H264Context *h, H264Picture *pic)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "mathops.h"
|
||||
#include "mpegutils.h"
|
||||
#include "rectangle.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
static const uint8_t field_scan[16+1] = {
|
||||
0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "mpegutils.h"
|
||||
#include "profiles.h"
|
||||
#include "rectangle.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 };
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "libavutil/internal.h"
|
||||
|
||||
#include "hevcdec.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
#define LUMA 0
|
||||
#define CB 1
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "hevc.h"
|
||||
#include "hevcdec.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
static const uint8_t l0_l1_cand_idx[12][2] = {
|
||||
{ 0, 1, },
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "thread.h"
|
||||
#include "hevc.h"
|
||||
#include "hevcdec.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags)
|
||||
{
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "hwconfig.h"
|
||||
#include "internal.h"
|
||||
#include "profiles.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 };
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "hpeldsp.h"
|
||||
#include "idctdsp.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
#define MIMIC_HEADER_SIZE 20
|
||||
#define MIMIC_VLC_BITS 11
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "h263.h"
|
||||
#include "h263dec.h"
|
||||
#include "profiles.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "xvididct.h"
|
||||
#include "unary.h"
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "mpeg4video.h"
|
||||
#include "mpegvideodata.h"
|
||||
#include "qpeldsp.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "wmv2.h"
|
||||
#include <limits.h>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "internal.h"
|
||||
#include "mpegutils.h"
|
||||
#include "mpegvideo.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "png.h"
|
||||
#include "pngdsp.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "internal.h"
|
||||
#include "pthread_internal.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "mpeg_er.h"
|
||||
#include "qpeldsp.h"
|
||||
#include "rectangle.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
|
||||
#include "rv34vlc.h"
|
||||
#include "rv34data.h"
|
||||
|
@ -70,32 +70,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
||||
*/
|
||||
void ff_thread_finish_setup(AVCodecContext *avctx);
|
||||
|
||||
/**
|
||||
* Notify later decoding threads when part of their reference picture is ready.
|
||||
* Call this when some part of the picture is finished decoding.
|
||||
* Later calls with lower values of progress have no effect.
|
||||
*
|
||||
* @param f The picture being decoded.
|
||||
* @param progress Value, in arbitrary units, of how much of the picture has decoded.
|
||||
* @param field The field being decoded, for field-picture codecs.
|
||||
* 0 for top field or frame pictures, 1 for bottom field.
|
||||
*/
|
||||
void ff_thread_report_progress(ThreadFrame *f, int progress, int field);
|
||||
|
||||
/**
|
||||
* Wait for earlier decoding threads to finish reference pictures.
|
||||
* Call this before accessing some part of a picture, with a given
|
||||
* value for progress, and it will return after the responsible decoding
|
||||
* thread calls ff_thread_report_progress() with the same or
|
||||
* higher value for progress.
|
||||
*
|
||||
* @param f The picture being referenced.
|
||||
* @param progress Value, in arbitrary units, to wait for.
|
||||
* @param field The field being referenced, for field-picture codecs.
|
||||
* 0 for top field or frame pictures, 1 for bottom field.
|
||||
*/
|
||||
void ff_thread_await_progress(ThreadFrame *f, int progress, int field);
|
||||
|
||||
#if FF_API_THREAD_SAFE_CALLBACKS
|
||||
/**
|
||||
* Wrapper around get_format() for frame-multithreaded codecs.
|
||||
|
53
libavcodec/threadframe.h
Normal file
53
libavcodec/threadframe.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_THREADFRAME_H
|
||||
#define AVCODEC_THREADFRAME_H
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "thread.h"
|
||||
|
||||
/**
|
||||
* Notify later decoding threads when part of their reference picture is ready.
|
||||
* Call this when some part of the picture is finished decoding.
|
||||
* Later calls with lower values of progress have no effect.
|
||||
*
|
||||
* @param f The picture being decoded.
|
||||
* @param progress Value, in arbitrary units, of how much of the picture has decoded.
|
||||
* @param field The field being decoded, for field-picture codecs.
|
||||
* 0 for top field or frame pictures, 1 for bottom field.
|
||||
*/
|
||||
void ff_thread_report_progress(ThreadFrame *f, int progress, int field);
|
||||
|
||||
/**
|
||||
* Wait for earlier decoding threads to finish reference pictures.
|
||||
* Call this before accessing some part of a picture, with a given
|
||||
* value for progress, and it will return after the responsible decoding
|
||||
* thread calls ff_thread_report_progress() with the same or
|
||||
* higher value for progress.
|
||||
*
|
||||
* @param f The picture being referenced.
|
||||
* @param progress Value, in arbitrary units, to wait for.
|
||||
* @param field The field being referenced, for field-picture codecs.
|
||||
* 0 for top field or frame pictures, 1 for bottom field.
|
||||
*/
|
||||
void ff_thread_await_progress(ThreadFrame *f, int progress, int field);
|
||||
|
||||
#endif
|
@ -37,6 +37,7 @@
|
||||
#include "codec.h"
|
||||
#include "hwconfig.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "internal.h"
|
||||
#include "put_bits.h"
|
||||
#include "startcode.h"
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "internal.h"
|
||||
#include "mathops.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "videodsp.h"
|
||||
#include "vp3data.h"
|
||||
#include "vp4data.h"
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "mathops.h"
|
||||
#include "rectangle.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "vp8.h"
|
||||
#include "vp8data.h"
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "internal.h"
|
||||
#include "profiles.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "pthread_internal.h"
|
||||
|
||||
#include "videodsp.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
|
||||
#include "threadframe.h"
|
||||
#include "vp56.h"
|
||||
#include "vp9.h"
|
||||
#include "vp9data.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "threadframe.h"
|
||||
#include "vp56.h"
|
||||
#include "vp9.h"
|
||||
#include "vp9data.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
#include "threadframe.h"
|
||||
#include "videodsp.h"
|
||||
#include "vp9data.h"
|
||||
#include "vp9dec.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
#include "thread.h"
|
||||
#include "threadframe.h"
|
||||
#include "unary.h"
|
||||
#include "wavpack.h"
|
||||
#include "dsd.h"
|
||||
|
Loading…
Reference in New Issue
Block a user