/* * exp golomb vlc stuff * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at> * Copyright (c) 2004 Alex Beregszaszi * * 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
*/
/** * @file * @brief * exp golomb vlc stuff * @author Michael Niedermayer <michaelni@gmx.at> and Alex Beregszaszi
*/
/** * Read an unsigned Exp-Golomb code in the range 0 to 8190. * * @returns the read value or a negative error code.
*/ staticinlineint get_ue_golomb(GetBitContext *gb)
{ unsignedint buf;
/** * Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
*/ staticinlineunsigned get_ue_golomb_long(GetBitContext *gb)
{ unsigned buf, log;
/** * read unsigned exp golomb code, constraint to a max of 31. * If the value encountered is not in 0..31, the return value * is outside the range 0..30.
*/ staticinlineint get_ue_golomb_31(GetBitContext *gb)
{ unsignedint buf;
/** * read signed golomb rice code (shorten).
*/ staticinlineint get_sr_golomb_shorten(GetBitContext *gb, int k)
{ int uvar = get_ur_golomb_jpegls(gb, k + 1, INT_MAX, 0); return (uvar >> 1) ^ -(uvar & 1);
}
#ifdef TRACE
staticinlineint get_ue(GetBitContext *s, constchar *file, constchar *func, int line)
{ int show = show_bits(s, 24); int pos = get_bits_count(s); int i = get_ue_golomb(s); int len = get_bits_count(s) - pos; int bits = show >> (24 - len);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue @%5d in %s %s:%d\n",
bits, len, i, pos, file, func, line);
return i;
}
staticinlineint get_se(GetBitContext *s, constchar *file, constchar *func, int line)
{ int show = show_bits(s, 24); int pos = get_bits_count(s); int i = get_se_golomb(s); int len = get_bits_count(s) - pos; int bits = show >> (24 - len);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se @%5d in %s %s:%d\n",
bits, len, i, pos, file, func, line);
return i;
}
staticinlineint get_te(GetBitContext *s, int r, char *file, constchar *func, int line)
{ int show = show_bits(s, 24); int pos = get_bits_count(s); int i = get_te0_golomb(s, r); int len = get_bits_count(s) - pos; int bits = show >> (24 - len);
av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te @%5d in %s %s:%d\n",
bits, len, i, pos, file, func, line);
¤ 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.0.15Bemerkung:
(vorverarbeitet)
¤
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.