/* * Copyright (c) 2010 Mans Rullgard <mans@mansr.com> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_INTMATH_H #define AVUTIL_INTMATH_H
#include <stdint.h>
#include"config.h" #include"attributes.h"
#if ARCH_ARM # include "arm/intmath.h" #elif ARCH_RISCV # include "riscv/intmath.h" #elif ARCH_X86 # include "x86/intmath.h" #endif
#ifndef ff_log2 #define ff_log2 ff_log2_c static av_always_inline av_const int ff_log2_c(unsignedint v)
{ int n = 0; if (v & 0xffff0000) {
v >>= 16;
n += 16;
} if (v & 0xff00) {
v >>= 8;
n += 8;
}
n += ff_log2_tab[v];
return n;
} #endif
#ifndef ff_log2_16bit #define ff_log2_16bit ff_log2_16bit_c static av_always_inline av_const int ff_log2_16bit_c(unsignedint v)
{ int n = 0; if (v & 0xff00) {
v >>= 8;
n += 8;
}
n += ff_log2_tab[v];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.