Go to the documentation of this file.
26 #include <media/NdkMediaFormat.h>
27 #include <media/NdkMediaCodec.h>
28 #include <android/native_window_jni.h>
66 {
"android/media/MediaCodecList",
"findDecoderForFormat",
"(Landroid/media/MediaFormat;)Ljava/lang/String;",
FF_JNI_METHOD, offsetof(
struct JNIAMediaCodecListFields, find_decoder_for_format_id), 0 },
73 {
"android/media/MediaCodecInfo",
"getCapabilitiesForType",
"(Ljava/lang/String;)Landroid/media/MediaCodecInfo$CodecCapabilities;",
FF_JNI_METHOD, offsetof(
struct JNIAMediaCodecListFields, get_codec_capabilities_id), 1 },
80 {
"android/media/MediaCodecInfo$CodecCapabilities",
"profileLevels",
"[Landroid/media/MediaCodecInfo$CodecProfileLevel;",
FF_JNI_FIELD, offsetof(
struct JNIAMediaCodecListFields, profile_levels_id), 1 },
123 {
"android/media/MediaFormat",
"getByteBuffer",
"(Ljava/lang/String;)Ljava/nio/ByteBuffer;",
FF_JNI_METHOD, offsetof(
struct JNIAMediaFormatFields, get_bytebuffer_id), 1 },
129 {
"android/media/MediaFormat",
"setByteBuffer",
"(Ljava/lang/String;Ljava/nio/ByteBuffer;)V",
FF_JNI_METHOD, offsetof(
struct JNIAMediaFormatFields, set_bytebuffer_id), 1 },
224 {
"android/media/MediaCodec",
"configure",
"(Landroid/media/MediaFormat;Landroid/view/Surface;Landroid/media/MediaCrypto;I)V",
FF_JNI_METHOD, offsetof(
struct JNIAMediaCodecFields, configure_id), 1 },
230 {
"android/media/MediaCodec",
"getOutputFormat",
"()Landroid/media/MediaFormat;",
FF_JNI_METHOD, offsetof(
struct JNIAMediaCodecFields, get_output_format_id), 1 },
237 {
"android/media/MediaCodec",
"dequeueOutputBuffer",
"(Landroid/media/MediaCodec$BufferInfo;J)I",
FF_JNI_METHOD, offsetof(
struct JNIAMediaCodecFields, dequeue_output_buffer_id), 1 },
289 #define JNI_GET_ENV_OR_RETURN(env, log_ctx, ret) do { \
290 (env) = ff_jni_get_env(log_ctx); \
296 #define JNI_GET_ENV_OR_RETURN_VOID(env, log_ctx) do { \
297 (env) = ff_jni_get_env(log_ctx); \
306 static const int AVCProfileBaseline = 0x01;
307 static const int AVCProfileMain = 0x02;
308 static const int AVCProfileExtended = 0x04;
309 static const int AVCProfileHigh = 0x08;
310 static const int AVCProfileHigh10 = 0x10;
311 static const int AVCProfileHigh422 = 0x20;
312 static const int AVCProfileHigh444 = 0x40;
313 static const int AVCProfileConstrainedBaseline = 0x10000;
314 static const int AVCProfileConstrainedHigh = 0x80000;
316 static const int HEVCProfileMain = 0x01;
317 static const int HEVCProfileMain10 = 0x02;
318 static const int HEVCProfileMainStill = 0x04;
319 static const int HEVCProfileMain10HDR10 = 0x1000;
320 static const int HEVCProfileMain10HDR10Plus = 0x2000;
322 static const int VP9Profile0 = 0x01;
323 static const int VP9Profile1 = 0x02;
324 static const int VP9Profile2 = 0x04;
325 static const int VP9Profile3 = 0x08;
326 static const int VP9Profile2HDR = 0x1000;
327 static const int VP9Profile3HDR = 0x2000;
328 static const int VP9Profile2HDR10Plus = 0x4000;
329 static const int VP9Profile3HDR10Plus = 0x8000;
331 static const int MPEG4ProfileSimple = 0x01;
332 static const int MPEG4ProfileSimpleScalable = 0x02;
333 static const int MPEG4ProfileCore = 0x04;
334 static const int MPEG4ProfileMain = 0x08;
335 static const int MPEG4ProfileNbit = 0x10;
336 static const int MPEG4ProfileScalableTexture = 0x20;
337 static const int MPEG4ProfileSimpleFBA = 0x80;
338 static const int MPEG4ProfileSimpleFace = 0x40;
339 static const int MPEG4ProfileBasicAnimated = 0x100;
340 static const int MPEG4ProfileHybrid = 0x200;
341 static const int MPEG4ProfileAdvancedRealTime = 0x400;
342 static const int MPEG4ProfileCoreScalable = 0x800;
343 static const int MPEG4ProfileAdvancedCoding = 0x1000;
344 static const int MPEG4ProfileAdvancedCore = 0x2000;
345 static const int MPEG4ProfileAdvancedScalable = 0x4000;
346 static const int MPEG4ProfileAdvancedSimple = 0x8000;
349 static const int AV1ProfileMain8 = 0x1;
350 static const int AV1ProfileMain10 = 0x2;
351 static const int AV1ProfileMain10HDR10 = 0x1000;
352 static const int AV1ProfileMain10HDR10Plus = 0x2000;
355 (void)AVCProfileConstrainedHigh;
356 (void)HEVCProfileMain10HDR10;
357 (void)HEVCProfileMain10HDR10Plus;
358 (void)VP9Profile2HDR;
359 (void)VP9Profile3HDR;
360 (void)VP9Profile2HDR10Plus;
361 (void)VP9Profile3HDR10Plus;
362 (void)AV1ProfileMain10;
363 (void)AV1ProfileMain10HDR10;
364 (void)AV1ProfileMain10HDR10Plus;
369 return AVCProfileBaseline;
371 return AVCProfileConstrainedBaseline;
373 return AVCProfileMain;
376 return AVCProfileExtended;
378 return AVCProfileHigh;
381 return AVCProfileHigh10;
384 return AVCProfileHigh422;
388 return AVCProfileHigh444;
393 return HEVCProfileMain;
395 return HEVCProfileMainStill;
397 return HEVCProfileMain10;
414 return MPEG4ProfileSimple;
416 return MPEG4ProfileSimpleScalable;
418 return MPEG4ProfileCore;
420 return MPEG4ProfileMain;
422 return MPEG4ProfileNbit;
424 return MPEG4ProfileScalableTexture;
426 return MPEG4ProfileSimpleFBA;
428 return MPEG4ProfileBasicAnimated;
430 return MPEG4ProfileHybrid;
432 return MPEG4ProfileAdvancedRealTime;
434 return MPEG4ProfileCoreScalable;
436 return MPEG4ProfileAdvancedCoding;
438 return MPEG4ProfileAdvancedCore;
440 return MPEG4ProfileAdvancedScalable;
442 return MPEG4ProfileAdvancedSimple;
452 return AV1ProfileMain8;
470 char *supported_type =
NULL;
476 jobject codec_name =
NULL;
480 jobjectArray types =
NULL;
482 jobject capabilities =
NULL;
483 jobject profile_level =
NULL;
484 jobjectArray profile_levels =
NULL;
501 for(
i = 0;
i < codec_count;
i++) {
521 if (is_encoder != encoder) {
531 if (is_software_only) {
547 (*env)->DeleteLocalRef(env, codec_name);
553 strstr(
name,
"OMX.google") ||
554 strstr(
name,
"OMX.ffmpeg") ||
555 (strstr(
name,
"OMX.SEC") && strstr(
name,
".sw.")) ||
556 !strcmp(
name,
"OMX.qcom.video.decoder.hevcswvdec")) {
560 type_count = (*env)->GetArrayLength(env, types);
561 for (j = 0; j < type_count; j++) {
565 type = (*env)->GetObjectArrayElement(env, types, j);
571 if (!supported_type) {
584 profile_levels = (*env)->GetObjectField(env, capabilities, jfields.
profile_levels_id);
589 profile_count = (*env)->GetArrayLength(env, profile_levels);
590 if (!profile_count) {
593 for (k = 0; k < profile_count; k++) {
594 int supported_profile = 0;
601 profile_level = (*env)->GetObjectArrayElement(env, profile_levels, k);
606 supported_profile = (*env)->GetIntField(env, profile_level, jfields.
profile_id);
611 found_codec =
profile == supported_profile;
614 (*env)->DeleteLocalRef(env, profile_level);
615 profile_level =
NULL;
624 if (profile_levels) {
625 (*env)->DeleteLocalRef(env, profile_levels);
626 profile_levels =
NULL;
630 (*env)->DeleteLocalRef(env, capabilities);
635 (*env)->DeleteLocalRef(env,
type);
648 (*env)->DeleteLocalRef(env,
info);
653 (*env)->DeleteLocalRef(env, types);
666 (*env)->DeleteLocalRef(env, codec_name);
670 (*env)->DeleteLocalRef(env,
info);
674 (*env)->DeleteLocalRef(env,
type);
678 (*env)->DeleteLocalRef(env, types);
682 (*env)->DeleteLocalRef(env, capabilities);
686 (*env)->DeleteLocalRef(env, profile_level);
689 if (profile_levels) {
690 (*env)->DeleteLocalRef(env, profile_levels);
709 jobject
object =
NULL;
727 object = (*env)->NewObject(env,
format->jfields.mediaformat_class,
format->jfields.init_id);
732 format->object = (*env)->NewGlobalRef(env,
object);
739 (*env)->DeleteLocalRef(env,
object);
771 format->object = (*env)->NewGlobalRef(env,
object);
797 (*env)->DeleteGlobalRef(env,
format->object);
838 jboolean contains_key;
850 contains_key = (*env)->CallBooleanMethod(env,
format->object,
format->jfields.contains_key_id,
key);
856 *
out = (*env)->CallIntMethod(env,
format->object,
format->jfields.get_integer_id,
key);
865 (*env)->DeleteLocalRef(env,
key);
877 jboolean contains_key;
889 contains_key = (*env)->CallBooleanMethod(env,
format->object,
format->jfields.contains_key_id,
key);
904 (*env)->DeleteLocalRef(env,
key);
916 jboolean contains_key;
928 contains_key = (*env)->CallBooleanMethod(env,
format->object,
format->jfields.contains_key_id,
key);
934 *
out = (*env)->CallFloatMethod(env,
format->object,
format->jfields.get_float_id,
key);
943 (*env)->DeleteLocalRef(env,
key);
955 jboolean contains_key;
968 contains_key = (*env)->CallBooleanMethod(env,
format->object,
format->jfields.contains_key_id,
key);
980 *
data = (*env)->GetDirectBufferAddress(env,
result);
981 *
size = (*env)->GetDirectBufferCapacity(env,
result);
997 (*env)->DeleteLocalRef(env,
key);
1001 (*env)->DeleteLocalRef(env,
result);
1013 jboolean contains_key;
1026 contains_key = (*env)->CallBooleanMethod(env,
format->object,
format->jfields.contains_key_id,
key);
1047 (*env)->DeleteLocalRef(env,
key);
1051 (*env)->DeleteLocalRef(env,
result);
1079 (*env)->DeleteLocalRef(env,
key);
1105 (*env)->DeleteLocalRef(env,
key);
1131 (*env)->DeleteLocalRef(env,
key);
1139 jstring
string =
NULL;
1156 (*env)->CallVoidMethod(env,
format->object,
format->jfields.set_string_id,
key,
string);
1163 (*env)->DeleteLocalRef(env,
key);
1167 (*env)->DeleteLocalRef(env,
string);
1211 (*env)->DeleteLocalRef(env,
key);
1215 (*env)->DeleteLocalRef(env,
buffer);
1273 #define CREATE_CODEC_BY_NAME 0
1274 #define CREATE_DECODER_BY_TYPE 1
1275 #define CREATE_ENCODER_BY_TYPE 2
1282 jstring jarg =
NULL;
1283 jobject
object =
NULL;
1284 jobject buffer_info =
NULL;
1285 jmethodID create_id =
NULL;
1316 object = (*env)->CallStaticObjectMethod(env,
1324 codec->
object = (*env)->NewGlobalRef(env,
object);
1342 codec->
buffer_info = (*env)->NewGlobalRef(env, buffer_info);
1350 (*env)->DeleteLocalRef(env, jarg);
1354 (*env)->DeleteLocalRef(env,
object);
1358 (*env)->DeleteLocalRef(env, buffer_info);
1363 (*env)->DeleteGlobalRef(env, codec->
object);
1377 #define DECLARE_FF_AMEDIACODEC_CREATE_FUNC(name, method) \
1378 static FFAMediaCodec *mediacodec_jni_##name(const char *arg) \
1380 return codec_create(method, arg); \
1410 (*env)->DeleteGlobalRef(env, codec->
object);
1441 (*env)->DeleteLocalRef(env,
name);
1658 jobject input_buffers =
NULL;
1674 codec->
input_buffers = (*env)->NewGlobalRef(env, input_buffers);
1686 ret = (*env)->GetDirectBufferAddress(env,
buffer);
1690 (*env)->DeleteLocalRef(env,
buffer);
1693 if (input_buffers) {
1694 (*env)->DeleteLocalRef(env, input_buffers);
1706 jobject output_buffers =
NULL;
1722 codec->
output_buffers = (*env)->NewGlobalRef(env, output_buffers);
1734 ret = (*env)->GetDirectBufferAddress(env,
buffer);
1738 (*env)->DeleteLocalRef(env,
buffer);
1741 if (output_buffers) {
1742 (*env)->DeleteLocalRef(env, output_buffers);
1754 jobject mediaformat =
NULL;
1766 (*env)->DeleteLocalRef(env, mediaformat);
1879 .createCodecByName = mediacodec_jni_createCodecByName,
1880 .createDecoderByType = mediacodec_jni_createDecoderByType,
1881 .createEncoderByType = mediacodec_jni_createEncoderByType,
1920 AMediaFormat *(*new)(void);
1921 media_status_t (*
delete)(AMediaFormat*);
1923 const char* (*toString)(AMediaFormat*);
1950 AMediaCodec* (*createCodecByName)(
const char *
name);
1951 AMediaCodec* (*createDecoderByType)(
const char *mime_type);
1952 AMediaCodec* (*createEncoderByType)(
const char *mime_type);
1953 media_status_t (*
delete)(AMediaCodec*);
1956 const AMediaFormat *
format,
1957 ANativeWindow *surface,
1958 AMediaCrypto *crypto,
1961 media_status_t (*
stop)(AMediaCodec*);
1964 uint8_t* (*getInputBuffer)(AMediaCodec*,
size_t idx,
size_t *
out_size);
1965 uint8_t* (*getOutputBuffer)(AMediaCodec*,
size_t idx,
size_t *
out_size);
1970 uint64_t time, uint32_t
flags);
1973 AMediaFormat* (*getOutputFormat)(AMediaCodec*);
1979 media_status_t (*
getName)(AMediaCodec*,
char** out_name);
2010 format->libmedia = dlopen(
"libmediandk.so", RTLD_NOW);
2014 #define GET_OPTIONAL_SYMBOL(sym) \
2015 format->sym = dlsym(format->libmedia, "AMediaFormat_" #sym);
2017 #define GET_SYMBOL(sym) \
2018 GET_OPTIONAL_SYMBOL(sym) \
2043 #undef GET_OPTIONAL_SYMBOL
2057 dlclose(
format->libmedia);
2079 dlclose(
format->libmedia);
2199 const char *lib_name =
"libmediandk.so";
2205 codec->
libmedia = dlopen(lib_name, RTLD_NOW);
2209 #define GET_SYMBOL(sym, required) \
2210 codec->sym = dlsym(codec->libmedia, "AMediaCodec_" #sym); \
2211 if (!codec->sym) { \
2212 av_log(codec, required ? AV_LOG_ERROR : AV_LOG_INFO, \
2213 #sym "() unavailable from %s\n", lib_name); \
2273 #define DECLARE_NDK_AMEDIACODEC_CREATE_FUNC(name, method) \
2274 static FFAMediaCodec *mediacodec_ndk_##name(const char *arg) \
2276 return ndk_codec_create(method, arg); \
2296 ANativeWindow_release(codec->
window);
2313 ANativeWindow *native_window =
NULL;
2319 native_window = ANativeWindow_fromSurface(env,
window->surface);
2321 codec->
window = native_window;
2322 }
else if (
window->native_window) {
2323 native_window =
window->native_window;
2332 if (
flags & AMEDIACODEC_CONFIGURE_FLAG_ENCODE) {
2339 if (
status != AMEDIA_OK) {
2348 if (
status != AMEDIA_OK) {
2354 if (
status != AMEDIA_OK) {
2363 #define MEDIACODEC_NDK_WRAPPER(method) \
2364 static int mediacodec_ndk_ ## method(FFAMediaCodec* ctx) \
2366 FFAMediaCodecNdk *codec = (FFAMediaCodecNdk *)ctx; \
2367 media_status_t status = codec->method(codec->impl); \
2369 if (status != AMEDIA_OK) { \
2370 av_log(codec, AV_LOG_ERROR, #method " failed, %d\n", status); \
2371 return AVERROR_EXTERNAL; \
2401 uint64_t time, uint32_t
flags)
2410 AMediaCodecBufferInfo buf_info = {0};
2414 info->offset = buf_info.offset;
2415 info->size = buf_info.size;
2416 info->presentationTimeUs = buf_info.presentationTimeUs;
2417 info->flags = buf_info.flags;
2438 if (
status != AMEDIA_OK) {
2452 if (
status != AMEDIA_OK) {
2462 return idx == AMEDIACODEC_INFO_TRY_AGAIN_LATER;
2467 return idx == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED;
2472 return idx == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED;
2477 return AMEDIACODEC_BUFFER_FLAG_CODEC_CONFIG;
2482 return AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM;
2492 return AMEDIACODEC_CONFIGURE_FLAG_ENCODE;
2511 if (
status != AMEDIA_OK) {
2548 .createCodecByName = mediacodec_ndk_createCodecByName,
2549 .createDecoderByType = mediacodec_ndk_createDecoderByType,
2550 .createEncoderByType = mediacodec_ndk_createEncoderByType,
2554 .start = mediacodec_ndk_start,
2555 .stop = mediacodec_ndk_stop,
2556 .flush = mediacodec_ndk_flush,
2615 #if __ANDROID_API__ >= 24
2627 ret = android_get_device_api_level();
2630 jclass versionClass;
2631 jfieldID sdkIntFieldID;
2634 versionClass = (*env)->FindClass(env,
"android/os/Build$VERSION");
2635 sdkIntFieldID = (*env)->GetStaticFieldID(env, versionClass,
"SDK_INT",
"I");
2636 ret = (*env)->GetStaticIntField(env, versionClass, sdkIntFieldID);
2637 (*env)->DeleteLocalRef(env, versionClass);
static void error(const char *err)
#define AV_LOG_WARNING
Something somehow does not look correct.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
#define AV_PROFILE_H264_HIGH_10_INTRA
#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define AV_PROFILE_MPEG4_N_BIT
AVColorTransferCharacteristic
Color Transfer Characteristic.
#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
#define AV_PROFILE_H264_MAIN
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define AV_PROFILE_HEVC_MAIN
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE
int ff_jni_reset_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfields_mapping, int global, void *log_ctx)
AVColorPrimaries
Chromaticity coordinates of the source primaries.
#define AV_PROFILE_AV1_PROFESSIONAL
#define AV_PROFILE_MPEG4_CORE_SCALABLE
#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE
#define AV_PROFILE_H264_EXTENDED
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
static SDL_Window * window
#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE
#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
jstring ff_jni_utf_chars_to_jstring(JNIEnv *env, const char *utf_chars, void *log_ctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
#define AV_PROFILE_MPEG4_HYBRID
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
#define AV_PROFILE_H264_HIGH_10
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_PROFILE_H264_HIGH_422_INTRA
int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfields_mapping, int global, void *log_ctx)
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
#define AV_PROFILE_H264_HIGH_422
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
and forward the result(frame or status change) to the corresponding input. If nothing is possible
#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
const char * av_default_item_name(void *ptr)
Return the context name.
JNIEnv * ff_jni_get_env(void *log_ctx)
#define AV_PROFILE_HEVC_MAIN_10
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_PRI_BT2020
ITU-R BT2020.
#define AV_PROFILE_MPEG4_ADVANCED_CORE
#define AV_PROFILE_MPEG4_ADVANCED_CODING
#define AVERROR_EXTERNAL
Generic error in an external library.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
#define AV_PROFILE_AV1_HIGH
char * ff_jni_jstring_to_utf_chars(JNIEnv *env, jstring string, void *log_ctx)
#define AV_PROFILE_MPEG4_SIMPLE
#define i(width, name, range_min, range_max)
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
AVColorSpace
YUV colorspace type.
int ff_jni_exception_check(JNIEnv *env, int log, void *log_ctx)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
#define AV_PROFILE_MPEG4_MAIN
#define AV_PROFILE_MPEG4_SIMPLE_STUDIO
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
#define AV_PROFILE_H264_HIGH_444_PREDICTIVE
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_PROFILE_H264_BASELINE
#define AV_PROFILE_MPEG4_CORE
Tag MUST be and< 10hcoeff half pel interpolation filter coefficients, hcoeff[0] are the 2 middle coefficients[1] are the next outer ones and so on, resulting in a filter like:...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ... the sign of the coefficients is not explicitly stored but alternates after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,... hcoeff[0] is not explicitly stored but found by subtracting the sum of all stored coefficients with signs from 32 hcoeff[0]=32 - hcoeff[1] - hcoeff[2] - ... a good choice for hcoeff and htaps is htaps=6 hcoeff={40,-10, 2} an alternative which requires more computations at both encoder and decoder side and may or may not be better is htaps=8 hcoeff={42,-14, 6,-2}ref_frames minimum of the number of available reference frames and max_ref_frames for example the first frame after a key frame always has ref_frames=1spatial_decomposition_type wavelet type 0 is a 9/7 symmetric compact integer wavelet 1 is a 5/3 symmetric compact integer wavelet others are reserved stored as delta from last, last is reset to 0 if always_reset||keyframeqlog quality(logarithmic quantizer scale) stored as delta from last, last is reset to 0 if always_reset||keyframemv_scale stored as delta from last, last is reset to 0 if always_reset||keyframe FIXME check that everything works fine if this changes between framesqbias dequantization bias stored as delta from last, last is reset to 0 if always_reset||keyframeblock_max_depth maximum depth of the block tree stored as delta from last, last is reset to 0 if always_reset||keyframequant_table quantization tableHighlevel bitstream structure:==============================--------------------------------------------|Header|--------------------------------------------|------------------------------------|||Block0||||split?||||yes no||||......... intra?||||:Block01 :yes no||||:Block02 :....... ..........||||:Block03 ::y DC ::ref index:||||:Block04 ::cb DC ::motion x :||||......... :cr DC ::motion y :||||....... ..........|||------------------------------------||------------------------------------|||Block1|||...|--------------------------------------------|------------ ------------ ------------|||Y subbands||Cb subbands||Cr subbands||||--- ---||--- ---||--- ---|||||LL0||HL0||||LL0||HL0||||LL0||HL0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||LH0||HH0||||LH0||HH0||||LH0||HH0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HL1||LH1||||HL1||LH1||||HL1||LH1|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HH1||HL2||||HH1||HL2||||HH1||HL2|||||...||...||...|||------------ ------------ ------------|--------------------------------------------Decoding process:=================------------|||Subbands|------------||||------------|Intra DC||||LL0 subband prediction ------------|\ Dequantization ------------------- \||Reference frames|\ IDWT|------- -------|Motion \|||Frame 0||Frame 1||Compensation . OBMC v -------|------- -------|--------------. \------> Frame n output Frame Frame<----------------------------------/|...|------------------- Range Coder:============Binary Range Coder:------------------- The implemented range coder is an adapted version based upon "Range encoding: an algorithm for removing redundancy from a digitised message." by G. N. N. Martin. The symbols encoded by the Snow range coder are bits(0|1). The associated probabilities are not fix but change depending on the symbol mix seen so far. bit seen|new state ---------+----------------------------------------------- 0|256 - state_transition_table[256 - old_state];1|state_transition_table[old_state];state_transition_table={ 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, 226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0};FIXME Range Coding of integers:------------------------- FIXME Neighboring Blocks:===================left and top are set to the respective blocks unless they are outside of the image in which case they are set to the Null block top-left is set to the top left block unless it is outside of the image in which case it is set to the left block if this block has no larger parent block or it is at the left side of its parent block and the top right block is not outside of the image then the top right block is used for top-right else the top-left block is used Null block y, cb, cr are 128 level, ref, mx and my are 0 Motion Vector Prediction:=========================1. the motion vectors of all the neighboring blocks are scaled to compensate for the difference of reference frames scaled_mv=(mv *(256 *(current_reference+1)/(mv.reference+1))+128)> the median of the scaled left
main external API structure.
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
#define AV_PROFILE_H264_HIGH
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
#define AV_PROFILE_H264_CONSTRAINED_BASELINE
char * av_strdup(const char *s)
Duplicate a string.
#define AV_PROFILE_H264_HIGH_444
void(* flush)(AVBSFContext *ctx)
#define AV_PROFILE_H264_HIGH_444_INTRA
#define flags(name, subs,...)
#define AV_PROFILE_AV1_MAIN
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
AVColorRange
Visual content value range.