This avoids the issue of whether it is defined behaviour to cast an
arbitrary int (or even intptr_t) value to a void* pointer. This is the
original approach used before commit 0915998add5918214fa0282a69b50a159168a6d5.
PiperOrigin-RevId: 295552115
Libgav1 recently added the ComputeFrameBufferInfo() and SetFrameBuffer()
helper functions for writing frame buffer callbacks. Using them
simplifies the Libgav1GetFrameBuffer() function.
Also resurrect the AlignTo16() function.
PiperOrigin-RevId: 295548330
fixes:
gav1_jni.cc:446:25: error: cast from pointer to smaller type 'int' loses information
const int buffer_id = reinterpret_cast<int>(buffer_private_data);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gav1_jni.cc:730:9: error: cast from pointer to smaller type 'int' loses information
reinterpret_cast<int>(decoder_buffer->buffer_private_data);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
after 0915998add
PiperOrigin-RevId: 295211245
The new code in Libgav1GetFrameBuffer is copied from
libgav1/src/frame_buffer_callback_adaptor.cc. It may become libgav1
utility functions available to libgav1 clients in the future.
The Libgav1FrameBuffer struct in the old frame buffer callback API is
defined as follows:
typedef struct Libgav1FrameBuffer {
uint8_t* data[3];
size_t size[3];
void* private_data;
} Libgav1FrameBuffer;
Copy these three fields to the JniFrameBuffer class as private data
members and add the RawBuffer() and Id() getter methods.
The existing AlignTo16 function is replaced by the copied Align template
function.
PiperOrigin-RevId: 293709205
+ force arm (over thumb) mode for 32-bit builds
-O2 improves performance ~30-40% over the default -Oz depending on the
resolution; this is similar to what is done for vp9 which uses -O3.
PiperOrigin-RevId: 290318121
Currently, ndk cpu-features is being used.
This is now deprecated and google open-source
cpu_features library is recommended.
PiperOrigin-RevId: 273987647
If a user has checked out libgav1 they almost certainly want to
build the extension, so fail if CMake is not present but
libgav1 is present. Also add a note to the README linking to
instructions for installing CMake.
Also remove the NDK check, as ndk.dir is apparently deprecated
and Android Studio appears to install this automatically anyway.
PiperOrigin-RevId: 273918142