On Wed, May 28, 2008 at 11:51:53PM -0400, Alexander Strange wrote:
>
> ---
> libavcodec/Makefile | 2 +-
> libavcodec/framethread.c | 342 +++++++++++++++++++++++++++++++++++++
> +++++++++
> libavcodec/thread.c | 7 +-
> libavcodec/utils.c | 7 +-
> 4 files changed, 353 insertions(+), 5 deletions(-)
> create mode 100644 libavcodec/framethread.c
[...]
> +void ff_report_decode_progress(AVFrame *f, int n) {
> + PerThreadContext *p;
> + int *progress;
> +
> + if (!f->avctx->thread_opaque) return;
> +
> + p = f->avctx->thread_opaque;
> + progress = f->thread_opaque;
> +
> + pthread_mutex_lock(&p->progress_mutex);
> + *progress = n;
> + pthread_cond_broadcast(&p->progress_cond);
> + pthread_mutex_unlock(&p->progress_mutex);
> +}
> +
> +void ff_await_decode_progress(AVFrame *f, int n) {
> + PerThreadContext *p;
> + int * volatile progress;
> +
> + if (!f->avctx->thread_opaque) return;
> +
> + p = f->avctx->thread_opaque;
> + progress = f->thread_opaque;
> +
> + if (*progress >= n) return;
> +
> + pthread_mutex_lock(&p->progress_mutex);
> + while (*progress < n)
> + pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
> + pthread_mutex_unlock(&p->progress_mutex);
> +}h264 can have up 1 motion vector per 4x4 pixels, thus if above is used to check the availability of some blocks, it will need to be very fast (millions of calls per second must take only a negligible amount of time) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct awnser.
signature.asc
Description: Digital signature
_______________________________________________ FFmpeg-soc mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc
