]>
Commit | Line | Data |
---|---|---|
8eca8599 JB |
1 | https://code.videolan.org/videolan/vlc/-/merge_requests/1618 |
2 | ||
3 | From 0efdfe8799b0100f41c5b8d6e1b43451001386cb Mon Sep 17 00:00:00 2001 | |
4 | From: Steve Lhomme <robux4@ycbcr.xyz> | |
5 | Date: Fri, 18 Mar 2022 11:42:49 +0100 | |
6 | Subject: [PATCH 1/2] dav1d: fix compilation with (upcoming) dav1d 1.0 | |
7 | ||
8 | (cherry picked from commit dbf45cea2a8abdfbef897b8a71f3eb782bb1b712) (edited) | |
9 | edited: | |
10 | - 3.0 has the 128 pixels padding elsewhere | |
11 | - 3.0 has an extra parameter for add_integer_with_range() | |
12 | - 3.0 was setting i_extra_picture_buffers further down in the code | |
13 | - 3.0 uses 16 threads max | |
14 | ||
15 | Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz> | |
16 | --- | |
17 | modules/codec/dav1d.c | 22 +++++++++++++++++++++- | |
18 | 1 file changed, 21 insertions(+), 1 deletion(-) | |
19 | ||
20 | diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c | |
21 | index 039165f52ec..cfabbc27cb3 100644 | |
22 | --- a/modules/codec/dav1d.c | |
23 | +++ b/modules/codec/dav1d.c | |
24 | @@ -63,10 +63,16 @@ vlc_module_begin () | |
25 | set_category(CAT_INPUT) | |
26 | set_subcategory(SUBCAT_INPUT_VCODEC) | |
27 | ||
28 | +#if DAV1D_API_VERSION_MAJOR >= 6 | |
29 | + add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_THREADS, | |
30 | + THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false) | |
31 | + add_obsolete_string("dav1d-thread-tiles") // unused with dav1d 1.0 | |
32 | +#else | |
33 | add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS, | |
34 | THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false) | |
35 | add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS, | |
36 | THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false) | |
37 | +#endif | |
38 | vlc_module_end () | |
39 | ||
40 | /***************************************************************************** | |
41 | @@ -294,6 +300,11 @@ static int OpenDecoder(vlc_object_t *p_this) | |
42 | return VLC_ENOMEM; | |
43 | ||
44 | dav1d_default_settings(&p_sys->s); | |
45 | +#if DAV1D_API_VERSION_MAJOR >= 6 | |
46 | + p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames"); | |
47 | + if (p_sys->s.n_threads == 0) | |
48 | + p_sys->s.n_threads = (i_core_count < 16) ? i_core_count : 16; | |
49 | +#else | |
50 | p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles"); | |
51 | if (p_sys->s.n_tile_threads == 0) | |
52 | p_sys->s.n_tile_threads = | |
53 | @@ -303,6 +314,7 @@ static int OpenDecoder(vlc_object_t *p_this) | |
54 | p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames"); | |
55 | if (p_sys->s.n_frame_threads == 0) | |
56 | p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16; | |
57 | +#endif | |
58 | p_sys->s.allocator.cookie = dec; | |
59 | p_sys->s.allocator.alloc_picture_callback = NewPicture; | |
60 | p_sys->s.allocator.release_picture_callback = FreePicture; | |
61 | @@ -313,12 +325,20 @@ static int OpenDecoder(vlc_object_t *p_this) | |
62 | return VLC_EGENERIC; | |
63 | } | |
64 | ||
65 | +#if DAV1D_API_VERSION_MAJOR >= 6 | |
66 | + msg_Dbg(p_this, "Using dav1d version %s with %d threads", | |
67 | + dav1d_version(), p_sys->s.n_threads); | |
68 | + | |
69 | + dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1); | |
70 | +#else | |
71 | msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads", | |
72 | dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads); | |
73 | ||
74 | + dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1); | |
75 | +#endif | |
76 | + | |
77 | dec->pf_decode = Decode; | |
78 | dec->pf_flush = FlushDecoder; | |
79 | - dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1); | |
80 | ||
81 | dec->fmt_out.video.i_width = dec->fmt_in.video.i_width; | |
82 | dec->fmt_out.video.i_height = dec->fmt_in.video.i_height; | |
83 | -- | |
84 | GitLab | |
85 | ||
86 | ||
87 | From b9d8c4079c6b0c4f8d8857a81dd3cfb9bdc67601 Mon Sep 17 00:00:00 2001 | |
88 | From: Steve Lhomme <robux4@ycbcr.xyz> | |
89 | Date: Wed, 12 Aug 2020 06:19:06 +0200 | |
90 | Subject: [PATCH 2/2] contrib: dav1d: update to 1.0.0 | |
91 | ||
92 | (cherry picked from commit c857056738aec2e66d21b54d2d086c60255e6a91) (edited) | |
93 | edited: | |
94 | - 3.0 had a different way to comment the git URL line | |
95 | ||
96 | Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz> | |
97 | --- | |
98 | contrib/src/dav1d/SHA512SUMS | 2 +- | |
99 | contrib/src/dav1d/rules.mak | 4 ++-- | |
100 | 2 files changed, 3 insertions(+), 3 deletions(-) | |
101 | ||
102 | diff --git a/contrib/src/dav1d/SHA512SUMS b/contrib/src/dav1d/SHA512SUMS | |
103 | index 5d7d593ae20..641f4f75698 100644 | |
104 | --- a/contrib/src/dav1d/SHA512SUMS | |
105 | +++ b/contrib/src/dav1d/SHA512SUMS | |
106 | @@ -1 +1 @@ | |
107 | -87026f8b14e408ff50fc8f137ec2ede4b14c5f69687e615d2359d0f718ae5cb5176522490786d9ae1f7838182f82615c2674f7c2961b6dcec83f1ee587c3af7c dav1d-0.9.2.tar.xz | |
108 | +a3a7e162e45181449cd42af3a4d36669a850a4ee9ab17641dcd63d84406444566e8ebc7caa55b0620ab581039f36d19a90218a40f52ebbe525b37ed9493fb3f3 dav1d-1.0.0.tar.xz | |
109 | diff --git a/contrib/src/dav1d/rules.mak b/contrib/src/dav1d/rules.mak | |
110 | index 9b4a508309a..e4583228316 100644 | |
111 | --- a/contrib/src/dav1d/rules.mak | |
112 | +++ b/contrib/src/dav1d/rules.mak | |
113 | @@ -1,6 +1,6 @@ | |
114 | # libdav1d | |
115 | ||
116 | -DAV1D_VERSION := 0.9.2 | |
117 | +DAV1D_VERSION := 1.0.0 | |
118 | DAV1D_URL := $(VIDEOLAN)/dav1d/$(DAV1D_VERSION)/dav1d-$(DAV1D_VERSION).tar.xz | |
119 | ||
120 | PKGS += dav1d | |
121 | @@ -12,7 +12,7 @@ DAV1D_CONF = -D enable_tests=false -D enable_tools=false | |
122 | ||
123 | $(TARBALLS)/dav1d-$(DAV1D_VERSION).tar.xz: | |
124 | $(call download_pkg,$(DAV1D_URL),dav1d) | |
125 | - #~ $(call download_git,$(DAV1D_URL),,$(DAV1D_HASH)) | |
126 | +# $(call download_git,$(DAV1D_GITURL),,$(DAV1D_HASH)) | |
127 | ||
128 | .sum-dav1d: dav1d-$(DAV1D_VERSION).tar.xz | |
129 | ||
130 | -- | |
131 | GitLab | |
132 |