summaryrefslogtreecommitdiff
path: root/chromium/third_party/dav1d/libdav1d/examples
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2022-12-16 22:37:46 +0000
committerMichael BrĂ¼ning <michael.bruning@qt.io>2023-03-27 08:12:03 +0000
commitc885ec409f9b6ffa25e03851729b1bc2ad2005b3 (patch)
tree0c9f205efc231ede87d2704b2780d1569caf5111 /chromium/third_party/dav1d/libdav1d/examples
parent0d63fc949d16f3e37ed7ab43d335b9d81cc6fdf7 (diff)
downloadqtwebengine-chromium-102-based.tar.gz
[Backport] Security bug 1401571102-based
Manual update of libdav1d to match the version introduced by patch https://chromium-review.googlesource.com/c/chromium/src/+/4114163: Roll src/third_party/dav1d/libdav1d/ 87f9a81cd..ed63a7459 (104 commits) This roll required a few changes to get working: - "properties" => "built in options" crossfile configuration change due to Meson deprecation. - generic config creation never worked, so fixed. - PPC64 configs were never checked in, so switched to generic. - copyright header changes for generate_sources. - Updated readme.chromium with potential issues that can arise. https://chromium.googlesource.com/external/github.com/videolan/dav1d.git/+log/87f9a81cd770..ed63a7459376 $ git log 87f9a81cd..ed63a7459 --date=short --no-merges --format='%ad %ae %s' 2022-12-09 jamrial dav1d: add an option to skip decoding some frame types 2022-12-08 jamrial picture: support creating and freeing refs without tile data 2022-12-07 gramner x86: Add 10bpc 8x32/32x8 itx AVX-512 (Ice Lake) asm 2022-12-07 gramner x86: Add minor DC-only IDCT optimizations 2022-12-13 gramner getbits: Fix assertion failure 2022-12-13 gramner checkasm: Fix integer overflow in refmvs test 2022-01-26 gramner dav1dplay: Update to new libplacebo API 2022-12-09 gramner Add minor getbits improvements 2022-12-09 gramner Add a separate getbits function for getting a single bit 2022-12-09 gramner Remove redundant zeroing in sequence header parsing 2022-12-09 gramner Set the correct default value of initial_display_delay 2022-12-09 jamrial tools: remove the null last entry in inloop_filters_tbl 2022-12-04 lu_zero Do not assume the picture allocation starts as the left edge 2022-11-21 lu_zero ppc: Allocate the correct temp buffer size 2022-11-21 lu_zero ppc: Do not use static const with vec_splats 2022-11-02 charlie.c.hayden Add info to dav1d_send_data docs 2022-10-30 jbeich build: drop -D_DARWIN_C_SOURCE on macOS/iOS after 6b611d36acab 2022-10-30 jbeich build: drop -D_POSIX_C_SOURCE on non-Linux after 6b611d36acab 2022-06-28 victorien threading: Add a pending list for async task insertion 2022-10-26 martin Implement atomic_compare_exchange_strong in the atomic compat headers 2022-10-06 victorien threading: Fix a race around frame completion (frame-mt) 2022-10-07 sebastian Handle host_machine.system() 'ios' and 'tvos' the same way as 'darwin' 2022-09-23 gramner x86: Add 10-bit 8x8/8x16/16x8/16x16 itx AVX-512 (Ice Lake) asm 2022-09-30 gramner Specify hidden visibility for global data symbol declarations 2022-09-28 gramner build: strip() the result of cc.get_define() 2022-09-26 gramner checkasm: Move printf format string to .rodata on x86 2022-09-26 gramner checkasm: Improve 32-bit parameter clobbering on x86-64 2022-09-26 gramner x86: Fix incorrect 32-bit parameter usage in high bit-depth AVX-512 mc 2022-09-09 martin arm: itx: Add clipping to row_clip_min/max in the 10 bpc codepaths 2022-09-15 gramner x86: Fix overflows in 12bpc AVX2 IDCT/IADST 2022-09-15 gramner x86: Fix overflows in 12bpc AVX2 DC-only IDCT 2022-09-15 gramner x86: Fix clipping in high bit-depth AVX2 4x16 IDCT 2022-03-21 martin Don't use gas-preprocessor with clang-cl for arm targets 2022-06-07 david_conrad Fix checking the reference dimesions for the projection process 2022-06-07 david_conrad Fix calculation of OBMC lap dimensions 2022-06-07 david_conrad Support film grain application whose only effect is clipping to video range 2022-06-07 david_conrad Ignore T.35 metadata if the OBU contains no payload 2022-06-07 david_conrad Fix chroma deblock filter size calculation for lossless 2022-06-07 david_conrad Fix rounding in the calculation of initialSubpelX 2022-06-07 david_conrad Fix overflow when saturating dequantized coefficients clipped to 0 2022-06-08 david_conrad Fix overflow in 8-bit NEON ADST 2022-09-14 martin tools: Allocate the priv structs with proper alignment 2022-09-08 gramner x86: Fix clipping in 10bpc SSE4.1 IDCT asm 2022-09-08 gramner build: Improve Windows linking options 2022-09-08 gramner tools: Improve demuxer probing 2022-08-30 code CI: Disable trimming on some tests 2022-08-30 code CI: Remove git 'safe.directory' config 2022-08-30 code gcovr: Ignore parsing errors 2022-08-30 code crossfiles: Update Android toolchains 2022-08-30 code CI: Update images (...) 2022-09-01 victorien checkasm: Add short options 2022-09-01 victorien checkasm: Add pattern matching to --test 2022-09-01 victorien checkasm: Remove pattern matching from --bench 2022-08-29 victorien checkasm: Add a --function option 2022-08-30 victorien threading: Fix copy_lpf_progress initialization 2022-08-19 jamrial data: don't overwrite the Dav1dDataProps size value 2022-07-18 gramner Adjust inlining attributes on some functions 2022-07-19 gramner x86: Remove leftover instruction in loopfilter AVX2 asm 2022-06-07 david_conrad Enable pointer authentication in assembly when building arm64e 2022-06-07 david_conrad Don't trash the return stack buffer in the NEON loop filter 2022-07-03 thresh CI: Removed snap package generation 2022-07-06 gramner Eliminate unused C DSP functions at compile time 2022-07-06 gramner cpu: Inline dav1d_get_cpu_flags() 2022-06-22 gramner x86: Add minor loopfilter asm improvements 2022-06-15 gramner checkasm: Speed up signal handling 2022-06-15 gramner checkasm: Improve seed generation on Windows 2022-06-20 gramner ci: Don't specify a specific MacOS version 2022-06-14 gramner x86: Add high bit-depth loopfilter AVX-512 (Ice Lake) asm 2022-06-13 victorien checkasm/lpf: Use operating dimensions 2022-06-03 gramner checkasm: Print the cpu model and cpuid signature on x86 2022-06-03 gramner checkasm: Add a vzeroupper check on x86 2022-06-02 gramner x86: Add a workaround for quirky AVX-512 hardware behavior 2022-05-31 victorien checkasm: Fix uninitialized variable 2022-05-14 code CI: Update coverage collecting 2022-05-05 code CI: Add a build with the minimum requirements 2022-05-05 code CI: Deactivate git 'safe.directory' 2022-03-24 code CI: Update images 2022-05-25 victorien Fix typo 2022-05-19 gramner x86: Add high bit-depth cdef_filter AVX-512 (Ice Lake) asm 2022-05-20 gramner checkasm: Print --help message to stderr instead of stdout 2022-05-20 gramner checkasm: Split cdef test into separate pri/sec/pri+sec parts 2022-05-20 gramner checkasm: Improve benchmarking of functions that modify their input 2022-05-18 b x86/itx_avx2: fix typo 2022-04-22 code CI: Add gcc12 and clang14 builds with mold linker 2022-04-26 code CI: Trigger documentation rebuild if configuration changes 2022-04-24 code meson/doc: Fix doxygen config 2022-04-28 gramner Use a relaxed memory ordering in dav1d_ref_inc() 2022-04-28 gramner Remove redundant code in dav1d_cdf_thread_unref() 2022-04-28 gramner Inline dav1d_ref_inc() 2022-04-24 code x86/itx: Add 32x8 12bpc AVX2 transforms 2022-04-24 code x86/itx: Add 8x32 12bpc AVX2 transforms 2022-04-24 code x86/itx: Deduplicate dconly code 2022-04-23 code lib: Fix typo in documentation 2022-04-07 jamrial obu: don't output invisible but showable key frames more than once 2022-04-07 jamrial obu: check that the frame referenced by existing_frame_idx is showable 2022-04-07 jamrial obu: check refresh_frame_flags is not equal to allFrames on Intra Only frames 2022-03-29 robux4 remove multipass wait from dav1d_decode_frame 2022-04-07 jamrial picture: ensure the new seq header and op param info flags are attached to the next visible picture in display order 2022-03-31 jamrial lib: add a function to query the decoder frame delay 2022-03-31 jamrial lib: split calculating thread count to its own function Created with: roll-dep src/third_party/dav1d/libdav1d Fixed: 1401571 Change-Id: Ic3cef540a87a2cf411abe6071fd4c9963ea61f75 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4114163 Reviewed-by: Wan-Teh Chang <wtc@google.com> Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/heads/main@{#1084574} Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/468619 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/third_party/dav1d/libdav1d/examples')
-rw-r--r--chromium/third_party/dav1d/libdav1d/examples/dp_renderer_placebo.c95
-rw-r--r--chromium/third_party/dav1d/libdav1d/examples/meson.build2
2 files changed, 45 insertions, 52 deletions
diff --git a/chromium/third_party/dav1d/libdav1d/examples/dp_renderer_placebo.c b/chromium/third_party/dav1d/libdav1d/examples/dp_renderer_placebo.c
index b16f6cfc728..4ab1415f44a 100644
--- a/chromium/third_party/dav1d/libdav1d/examples/dp_renderer_placebo.c
+++ b/chromium/third_party/dav1d/libdav1d/examples/dp_renderer_placebo.c
@@ -49,31 +49,31 @@ typedef struct renderer_priv_ctx
{
// SDL window
SDL_Window *win;
- // Placebo context
- struct pl_context *ctx;
+ // Placebo log
+ pl_log log;
// Placebo renderer
- struct pl_renderer *renderer;
+ pl_renderer renderer;
#ifdef HAVE_PLACEBO_VULKAN
// Placebo Vulkan handle
- const struct pl_vulkan *vk;
+ pl_vulkan vk;
// Placebo Vulkan instance
- const struct pl_vk_inst *vk_inst;
+ pl_vk_inst vk_inst;
// Vulkan surface
VkSurfaceKHR surf;
#endif
#ifdef HAVE_PLACEBO_OPENGL
// Placebo OpenGL handle
- const struct pl_opengl *gl;
+ pl_opengl gl;
#endif
// Placebo GPU
- const struct pl_gpu *gpu;
+ pl_gpu gpu;
// Placebo swapchain
- const struct pl_swapchain *swapchain;
+ pl_swapchain swapchain;
// Lock protecting access to the texture
SDL_mutex *lock;
// Image to render, and planes backing them
struct pl_frame image;
- const struct pl_tex *plane_tex[3];
+ pl_tex plane_tex[3];
} Dav1dPlayRendererPrivateContext;
static Dav1dPlayRendererPrivateContext*
@@ -85,24 +85,23 @@ static Dav1dPlayRendererPrivateContext*
return NULL;
// Alloc
- Dav1dPlayRendererPrivateContext *rd_priv_ctx = malloc(sizeof(Dav1dPlayRendererPrivateContext));
- if (rd_priv_ctx == NULL) {
+ Dav1dPlayRendererPrivateContext *const rd_priv_ctx =
+ calloc(1, sizeof(Dav1dPlayRendererPrivateContext));
+ if (rd_priv_ctx == NULL)
return NULL;
- }
- *rd_priv_ctx = (Dav1dPlayRendererPrivateContext) {0};
rd_priv_ctx->win = sdlwin;
// Init libplacebo
- rd_priv_ctx->ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
+ rd_priv_ctx->log = pl_log_create(PL_API_VER, pl_log_params(
.log_cb = pl_log_color,
#ifndef NDEBUG
.log_level = PL_LOG_DEBUG,
#else
.log_level = PL_LOG_WARN,
#endif
- });
- if (rd_priv_ctx->ctx == NULL) {
+ ));
+ if (rd_priv_ctx->log == NULL) {
free(rd_priv_ctx);
return NULL;
}
@@ -111,7 +110,7 @@ static Dav1dPlayRendererPrivateContext*
rd_priv_ctx->lock = SDL_CreateMutex();
if (rd_priv_ctx->lock == NULL) {
fprintf(stderr, "SDL_CreateMutex failed: %s\n", SDL_GetError());
- pl_context_destroy(&(rd_priv_ctx->ctx));
+ pl_log_destroy(&rd_priv_ctx->log);
free(rd_priv_ctx);
return NULL;
}
@@ -133,26 +132,24 @@ static void *placebo_renderer_create_gl(void)
return NULL;
sdlwin = rd_priv_ctx->win;
- // Init OpenGL
- struct pl_opengl_params params = { 0 };
-# ifndef NDEBUG
- params.debug = true;
-# endif
-
SDL_GLContext glcontext = SDL_GL_CreateContext(sdlwin);
SDL_GL_MakeCurrent(sdlwin, glcontext);
- rd_priv_ctx->gl = pl_opengl_create(rd_priv_ctx->ctx, &params);
+ rd_priv_ctx->gl = pl_opengl_create(rd_priv_ctx->log, pl_opengl_params(
+#ifndef NDEBUG
+ .debug = true,
+#endif
+ ));
if (!rd_priv_ctx->gl) {
fprintf(stderr, "Failed creating opengl device!\n");
exit(2);
}
rd_priv_ctx->swapchain = pl_opengl_create_swapchain(rd_priv_ctx->gl,
- &(struct pl_opengl_swapchain_params) {
+ pl_opengl_swapchain_params(
.swap_buffers = (void (*)(void *)) SDL_GL_SwapWindow,
.priv = sdlwin,
- });
+ ));
if (!rd_priv_ctx->swapchain) {
fprintf(stderr, "Failed creating opengl swapchain!\n");
@@ -211,11 +208,10 @@ static void *placebo_renderer_create_vk(void)
printf(" %s\n", extensions[i]);
}
- struct pl_vk_inst_params iparams = { 0 };
- iparams.extensions = extensions;
- iparams.num_extensions = num;
-
- rd_priv_ctx->vk_inst = pl_vk_inst_create(rd_priv_ctx->ctx, &iparams);
+ rd_priv_ctx->vk_inst = pl_vk_inst_create(rd_priv_ctx->log, pl_vk_inst_params(
+ .extensions = extensions,
+ .num_extensions = num,
+ ));
if (!rd_priv_ctx->vk_inst) {
fprintf(stderr, "Failed creating Vulkan instance!\n");
exit(1);
@@ -227,12 +223,11 @@ static void *placebo_renderer_create_vk(void)
exit(1);
}
- struct pl_vulkan_params params = pl_vulkan_default_params;
- params.instance = rd_priv_ctx->vk_inst->instance;
- params.surface = rd_priv_ctx->surf;
- params.allow_software = true;
-
- rd_priv_ctx->vk = pl_vulkan_create(rd_priv_ctx->ctx, &params);
+ rd_priv_ctx->vk = pl_vulkan_create(rd_priv_ctx->log, pl_vulkan_params(
+ .instance = rd_priv_ctx->vk_inst->instance,
+ .surface = rd_priv_ctx->surf,
+ .allow_software = true,
+ ));
if (!rd_priv_ctx->vk) {
fprintf(stderr, "Failed creating vulkan device!\n");
exit(2);
@@ -240,10 +235,10 @@ static void *placebo_renderer_create_vk(void)
// Create swapchain
rd_priv_ctx->swapchain = pl_vulkan_create_swapchain(rd_priv_ctx->vk,
- &(struct pl_vulkan_swapchain_params) {
+ pl_vulkan_swapchain_params(
.surface = rd_priv_ctx->surf,
.present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR,
- });
+ ));
if (!rd_priv_ctx->swapchain) {
fprintf(stderr, "Failed creating vulkan swapchain!\n");
@@ -289,7 +284,7 @@ static void placebo_renderer_destroy(void *cookie)
SDL_DestroyWindow(rd_priv_ctx->win);
- pl_context_destroy(&(rd_priv_ctx->ctx));
+ pl_log_destroy(&rd_priv_ctx->log);
}
static void placebo_render(void *cookie, const Dav1dPlaySettings *settings)
@@ -305,7 +300,7 @@ static void placebo_render(void *cookie, const Dav1dPlaySettings *settings)
// Prepare rendering
if (rd_priv_ctx->renderer == NULL) {
- rd_priv_ctx->renderer = pl_renderer_create(rd_priv_ctx->ctx, rd_priv_ctx->gpu);
+ rd_priv_ctx->renderer = pl_renderer_create(rd_priv_ctx->log, rd_priv_ctx->gpu);
}
struct pl_swapchain_frame frame;
@@ -315,17 +310,16 @@ static void placebo_render(void *cookie, const Dav1dPlaySettings *settings)
return;
}
- struct pl_render_params render_params = {0};
- if (settings->highquality)
- render_params = pl_render_default_params;
-
struct pl_frame target;
pl_frame_from_swapchain(&target, &frame);
pl_rect2df_aspect_copy(&target.crop, &rd_priv_ctx->image.crop, 0.0);
if (pl_frame_is_cropped(&target))
pl_tex_clear(rd_priv_ctx->gpu, frame.fbo, (float[4]){ 0.0 });
- if (!pl_render_image(rd_priv_ctx->renderer, &rd_priv_ctx->image, &target, &render_params)) {
+ if (!pl_render_image(rd_priv_ctx->renderer, &rd_priv_ctx->image, &target,
+ settings->highquality ? &pl_render_default_params
+ : &pl_render_fast_params))
+ {
fprintf(stderr, "Failed rendering frame!\n");
pl_tex_clear(rd_priv_ctx->gpu, frame.fbo, (float[4]){ 1.0 });
}
@@ -351,15 +345,14 @@ static int placebo_upload_image(void *cookie, Dav1dPicture *dav1d_pic,
if (!dav1d_pic)
return ret;
- struct pl_dav1d_upload_params params = {
+ SDL_LockMutex(p->lock);
+ if (!pl_upload_dav1dpicture(p->gpu, &p->image, p->plane_tex, pl_dav1d_upload_params(
.picture = dav1d_pic,
.film_grain = settings->gpugrain,
.gpu_allocated = settings->zerocopy,
.asynchronous = true,
- };
-
- SDL_LockMutex(p->lock);
- if (!pl_upload_dav1dpicture(p->gpu, &p->image, p->plane_tex, &params)) {
+ )))
+ {
fprintf(stderr, "Failed uploading planes!\n");
p->image = (struct pl_frame) {0};
ret = -1;
diff --git a/chromium/third_party/dav1d/libdav1d/examples/meson.build b/chromium/third_party/dav1d/libdav1d/examples/meson.build
index 124c9566516..2b2b8bd5adc 100644
--- a/chromium/third_party/dav1d/libdav1d/examples/meson.build
+++ b/chromium/third_party/dav1d/libdav1d/examples/meson.build
@@ -46,7 +46,7 @@ if sdl2_dependency.found()
dav1dplay_deps = [sdl2_dependency, libm_dependency]
dav1dplay_cflags = []
- placebo_dependency = dependency('libplacebo', version: '>= 3.110.0', required: false)
+ placebo_dependency = dependency('libplacebo', version: '>= 4.160.0', required: false)
if placebo_dependency.found()
dav1dplay_deps += placebo_dependency