Skip to content
Snippets Groups Projects
Commit 6c433a08 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

ffmpeg: use release tarball

Github mirror got some problem with nvenc

Change-Id: Ia731d5827f20e38a4866af394a8c3bc0f5b58147
parent 81b299b7
No related branches found
No related tags found
No related merge requests found
da1b836c8f51cf69f95db750d5da5191a71d534fa7b0f019d6d6454f8dd6db5598789576b4fe5ad983dcd0197b9a7e8f9d43f10707b6d40ac31425da23da35b2 ffmpeg-n6.0.tar.gz
8a86b2db4a9abb68bb86d770ba1babb76c8b8313cfb0258ae70c88e736a93b99c342a6ecda94b739e8e7c103bed75d4afd756dd94e08c6255f424ef62c264741 ffmpeg-6.0.1.tar.xz
libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
index 6298f5e..ca7e2df 100644
--- a/libavcodec/x86/mathops.h
+++ b/libavcodec/x86/mathops.h
@@ -35,12 +35,20 @@
static av_always_inline av_const int MULL(int a, int b, unsigned shift)
{
int rt, dummy;
+ if (__builtin_constant_p(shift))
__asm__ (
"imull %3 \n\t"
"shrdl %4, %%edx, %%eax \n\t"
:"=a"(rt), "=d"(dummy)
- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
+ :"a"(a), "rm"(b), "i"(shift & 0x1F)
);
+ else
+ __asm__ (
+ "imull %3 \n\t"
+ "shrdl %4, %%edx, %%eax \n\t"
+ :"=a"(rt), "=d"(dummy)
+ :"a"(a), "rm"(b), "c"((uint8_t)shift)
+ );
return rt;
}
@@ -113,19 +121,31 @@ __asm__ volatile(\
// avoid +32 for shift optimization (gcc should do that ...)
#define NEG_SSR32 NEG_SSR32
static inline int32_t NEG_SSR32( int32_t a, int8_t s){
+ if (__builtin_constant_p(s))
__asm__ ("sarl %1, %0\n\t"
: "+r" (a)
- : "ic" ((uint8_t)(-s))
+ : "i" (-s & 0x1F)
);
+ else
+ __asm__ ("sarl %1, %0\n\t"
+ : "+r" (a)
+ : "c" ((uint8_t)(-s))
+ );
return a;
}
#define NEG_USR32 NEG_USR32
static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
+ if (__builtin_constant_p(s))
__asm__ ("shrl %1, %0\n\t"
: "+r" (a)
- : "ic" ((uint8_t)(-s))
+ : "i" (-s & 0x1F)
);
+ else
+ __asm__ ("shrl %1, %0\n\t"
+ : "+r" (a)
+ : "c" ((uint8_t)(-s))
+ );
return a;
}
---
libavcodec/nvenc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 8a28454042..c091fe2d31 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1853,7 +1853,8 @@ av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
p_nvenc->nvEncEncodePicture(ctx->nvencoder, &params);
}
- reorder_queue_flush(ctx->reorder_queue);
+ if (ctx->reorder_queue)
+ reorder_queue_flush(ctx->reorder_queue);
av_fifo_freep2(&ctx->reorder_queue);
av_fifo_freep2(&ctx->output_surface_ready_queue);
av_fifo_freep2(&ctx->output_surface_queue);
--
2.34.1
FFMPEG_HASH := n6.0
FFMPEG_URL := https://github.com/FFmpeg/FFmpeg/archive/refs/tags/$(FFMPEG_HASH).tar.gz
FFMPEG_HASH := 6.0.1
FFMPEG_URL := https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_HASH).tar.xz
PKGS+=ffmpeg
......@@ -350,12 +350,14 @@ FFMPEGCONF += --target-os=mingw32 \
--enable-encoder=hevc_nvenc
endif
$(TARBALLS)/ffmpeg-$(FFMPEG_HASH).tar.gz:
$(TARBALLS)/ffmpeg-$(FFMPEG_HASH).tar.xz:
$(call download,$(FFMPEG_URL))
.sum-ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.gz
.sum-ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.xz
$(warning $@ not implemented)
touch $@
ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.gz
ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.xz
rm -Rf $@ $@-$(FFMPEG_HASH)
mkdir -p $@-$(FFMPEG_HASH)
(cd $@-$(FFMPEG_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f $<)
......@@ -366,8 +368,6 @@ ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.gz
$(APPLY) $(SRC)/ffmpeg/libopusenc-reload-packet-loss-at-encode.patch
$(APPLY) $(SRC)/ffmpeg/ios-disable-b-frames.patch
$(APPLY) $(SRC)/ffmpeg/screen-sharing-x11-fix.patch
$(APPLY) $(SRC)/ffmpeg/nvenc-fix-reorderqueueflush-crash.patch
$(APPLY) $(SRC)/ffmpeg/binutil-support.patch
$(UPDATE_AUTOCONFIG)
$(MOVE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment