- DPX image encoder
- SMPTE 302M AES3 audio decoder
- ffmpeg no longer quits after the 'q' key is pressed; use 'ctrl+c' instead
-- 9bit and 10bit per sample support in the H.264 decoder
+- 9 bits and 10 bits per sample support in the H.264 decoder
version 0.7_beta1:
- rate distorted optimal lambda->qp support
- AAC encoding with libfaac
- Sunplus JPEG codec (SP5X) support
-- use Lagrange multipler instead of QP for ratecontrol
+- use Lagrange multiplier instead of QP for ratecontrol
- Theora/VP3 decoding support
- XA and ADX ADPCM codecs
- export MPEG-2 active display area / pan scan
/*
* avconv main
- * Copyright (c) 2000-2011 The libav developers.
+ * Copyright (c) 2000-2011 The Libav developers
*
* This file is part of Libav.
*
return 0;
av_get_channel_layout_string(layout_name, sizeof(layout_name),
dec->channels, dec->channel_layout);
- av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream "
+ av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream "
"#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name);
}
return 1;
for (i = 0; i < ost->nb_bitstream_filters; i++) {
ret = av_bsf_alloc(ost->bitstream_filters[i], &ctx);
if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error allocating a bistream filter context\n");
+ av_log(NULL, AV_LOG_ERROR, "Error allocating a bitstream filter context\n");
return ret;
}
ost->bsf_ctx[i] = ctx;
ret = av_bsf_init(ctx);
if (ret < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error initializing bistream filter: %s\n",
+ av_log(NULL, AV_LOG_ERROR, "Error initializing bitstream filter: %s\n",
ost->bitstream_filters[i]->name);
return ret;
}
ic->flags |= AVFMT_FLAG_NONBLOCK;
ic->interrupt_callback = int_cb;
- /* open the input file with generic libav function */
+ /* open the input file with generic Libav function */
err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts);
if (err < 0) {
print_error(filename, err);
}
/* update video clock for next frame */
frame_delay = av_q2d(is->video_dec->time_base);
- /* for MPEG2, the frame can be repeated, so we update the
+ /* For MPEG-2, the frame can be repeated, so we update the
clock accordingly */
frame_delay += src_frame->repeat_pict * (frame_delay * 0.5);
is->video_clock += frame_delay;
/* init averaging filter */
is->audio_diff_avg_coef = exp(log(0.01) / AUDIO_DIFF_AVG_NB);
is->audio_diff_avg_count = 0;
- /* since we do not have a precise anough audio fifo fullness,
+ /* since we do not have a precise enough audio FIFO fullness,
we correct audio sync only if larger than this threshold */
is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / avctx->sample_rate;
/* globals */
static const OptionDef *options;
-/* AVprobe context */
+/* avprobe context */
static const char *input_filename;
static AVInputFormat *iformat = NULL;
2016-xx-xx - xxxxxxx - lavc 57.15.0 - avcodec.h
Add a new bitstream filtering API working with AVPackets.
- Deprecate the old bistream filtering API.
+ Deprecate the old bitstream filtering API.
2016-xx-xx - xxxxxxx - lavfi 6.3.0 - avfilter.h
Add AVFilterContext.hw_device_ctx.
2013-08-05 - f824535 - lavc 55.13.0 - avcodec.h
Deprecate the bitstream-related members from struct AVVDPAUContext.
- The bistream buffers no longer need to be explicitly freed.
+ The bitstream buffers no longer need to be explicitly freed.
2013-08-05 - 549294f - lavc 55.12.0 - avcodec.h
Deprecate the CODEC_CAP_HWACCEL_VDPAU codec capability. Use CODEC_CAP_HWACCEL
* base -- is now stored in AVBufferRef
* reference, type, buffer_hints -- are unnecessary in the new API
* hwaccel_picture_private, owner, thread_opaque -- should not
- have been acessed from outside of lavc
+ have been accessed from outside of lavc
* qscale_table, qstride, qscale_type, mbskip_table, motion_val,
mb_type, dct_coeff, ref_index -- mpegvideo-specific tables,
which are not exported anymore.
If this option is not specified, the default adapter is used.
@item qsv
-For QSV, this option corresponds to the valus of MFX_IMPL_* . Allowed values
+For QSV, this option corresponds to the values of MFX_IMPL_* . Allowed values
are:
@table @option
@item auto
@end example
@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
-Set bitstream filters for matching streams. @var{bistream_filters} is
+Set bitstream filters for matching streams. @var{bitstream_filters} is
a comma-separated list of bitstream filters. Use the @code{-bsfs} option
to get the list of bitstream filters.
@example
@chapter Description
@c man begin DESCRIPTION
-AVplay is a very simple and portable media player using the Libav
+avplay is a very simple and portable media player using the Libav
libraries and the SDL library. It is mostly used as a testbed for the
various Libav APIs.
@c man end
@ignore
@setfilename avplay
-@settitle AVplay media player
+@settitle avplay media player
@c man begin SEEALSO
avconv(1), avprobe(1) and the Libav HTML documentation
A stream specifier is a string generally appended to the option name and
separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains
-@code{a:1} stream specifer, which matches the second audio stream. Therefore it
+@code{a:1} stream specifier, which matches the second audio stream. Therefore it
would select the ac3 codec for the second audio stream.
A stream specifier can match several stream, the option is then applied to all
rational.c code to perform exact calculations with rational numbers
tree.c generic AVL tree
crc.c generic CRC checksumming code
-integer.c 128bit integer math
+integer.c 128-bit integer math
lls.c
mathematics.c greatest common divisor, integer sqrt, integer log2, ...
mem.c memory allocation routines with guaranteed alignment
audio or video streams.
@end itemize
-@section Integrating libav in your program
+@section Integrating Libav in your program
Shared libraries should be used whenever is possible in order to reduce
the effort distributors have to pour to support programs and to ensure
If the code changed has already a test present in FATE you should run it,
otherwise it is advised to add it.
-Improvements to codec or demuxer might change the FATE results. Make sure
+Improvements to a codec or demuxer might change the FATE results. Make sure
to commit the update reference with the change and to explain in the comment
why the expected result changed.
@subsection Speed considerations
In the default mode of operation the encoder has to honor frame constraints
-(i.e. not produc frames with size bigger than requested) while still making
-output picture as good as possible.
+(i.e. not produce frames with a size larger than requested) while still making
+the output picture as good as possible.
A frame containing a lot of small details is harder to compress and the encoder
would spend more time searching for appropriate quantizers for each slice.
* libavcodec API use example.
*
* @example avcodec.c
- * Note that this library only handles codecs (mpeg, mpeg4, etc...),
- * not file formats (avi, vob, etc...). See library 'libavformat' for the
- * format handling
+ * Note that this library only handles codecs (MPEG, MPEG-4, etc...),
+ * not file formats (AVI, VOB, etc...). See library 'libavformat' for the
+ * format handling.
*/
#include <stdlib.h>
printf("Audio decoding\n");
- /* find the mpeg audio decoder */
+ /* find the MPEG audio decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
if (!codec) {
fprintf(stderr, "codec not found\n");
printf("Video encoding\n");
- /* find the mpeg1 video encoder */
+ /* find the mpeg1video encoder */
codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);
if (!codec) {
fprintf(stderr, "codec not found\n");
}
}
- /* add sequence end code to have a real mpeg file */
+ /* add sequence end code to have a real MPEG file */
fwrite(endcode, 1, sizeof(endcode), f);
fclose(f);
av_init_packet(&avpkt);
- /* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
+ /* set end of buffer to 0 (this ensures that no overreading happens for damaged MPEG streams) */
memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
printf("Video decoding\n");
- /* find the mpeg1 video decoder */
+ /* find the MPEG-1 video decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO);
if (!codec) {
fprintf(stderr, "codec not found\n");
}
}
- /* some codecs, such as MPEG, transmit the I and P frame with a
+ /* Some codecs, such as MPEG, transmit the I- and P-frame with a
latency of one frame. You must do the following to have a
- chance to get the last frame of the video */
+ chance to get the last frame of the video. */
avpkt.data = NULL;
avpkt.size = 0;
len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
c->pix_fmt = STREAM_PIX_FMT;
if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
- /* just for testing, we also add B frames */
+ /* just for testing, we also add B-frames */
c->max_b_frames = 2;
}
if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
@chapter Introduction
-FATE provides a regression testsuite embedded within the Libav build system.
+FATE provides a regression test suite embedded within the Libav build system.
It can be run locally and optionally configured to send reports to a web
aggregator and viewer @url{http://fate.libav.org}.
In order to run, FATE needs a large amount of data (samples and references)
that is provided separately from the actual source distribution.
-To inform the build system about the testsuite location, pass
+To inform the build system about the test suite location, pass
@option{--samples=<path to the samples>} to @command{configure} or set the
@var{SAMPLES} Make variable or the @var{LIBAV_SAMPLES} environment variable
to a suitable value.
List all fate/regression test targets.
@item fate-rsync
-Shortcut to download the fate test samples to the specified testsuite location.
+Shortcut to download the fate test samples to the specified test suite location.
@item fate
Run the FATE test suite (requires the fate-suite dataset).
@section gradfun
Fix the banding artifacts that are sometimes introduced into nearly flat
-regions by truncation to 8bit colordepth.
+regions by truncation to 8-bit colordepth.
Interpolate the gradients that should go where the bands are, and
dither them.
Overlay one video on top of another.
It takes two inputs and has one output. The first input is the "main"
-video on which the second input is overlayed.
+video on which the second input is overlaid.
It accepts the following parameters:
# Select only frames contained in the 10-20 time interval
select='gte(t\,10)*lte(t\,20)'
-# Select only I frames contained in the 10-20 time interval
+# Select only I-frames contained in the 10-20 time interval
select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
# Select frames with a minimum distance of 10 seconds
The following graph description will generate a red source
with an opacity of 0.2, with size "qcif" and a frame rate of 10
-frames per second, which will be overlayed over the source connected
+frames per second, which will be overlaid over the source connected
to the pad with identifier "in":
@example
An example:
@example
# Generate a frei0r partik0l source with size 200x200 and framerate 10
-# which is overlayed on the overlay filter main input
+# which is overlaid on the overlay filter's main input
frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
@end example
changes may have thrown off the results of your testing.
@end itemize
-Next let the code pass through a full run of our testsuite. Before you do,
+Next let the code pass through a full run of our test suite. Before you do,
the command @command{make fate-rsync} will update the test samples. Changes
to the samples set are not very common and commits depending on samples
changes are delayed for at least 24 hours to allow the new samples to
-grab_x @var{x_offset} -grab_y @var{y_offset}
@end example
-Set the grabing region coordinates. The are expressed as offset from the top left
+Set the grabbing region coordinates. The are expressed as offset from the top left
corner of the X11 window. The default value is 0.
@c man end INPUT DEVICES
The BROADCAST variant provides a secondary time reference to facilitate
detecting endpoint latency and network delays.
-It assumes all the endpoint clocks are syncronized.
+It assumes all the endpoint clocks are synchronized.
To be used in real-time scenarios.
@section PIPE
then take a look in the x86/ directory, as most important functions are
already optimized for MMX.
-If you want to do x86 optimizations then you can either try to finetune the
+If you want to do x86 optimizations then you can either try to fine-tune the
stuff in the x86 directory or find some other functions in the C source to
optimize, but there aren't many left.
particularly important on Win64, where xmm6-15 are callee-save, and not
restoring their contents leads to undefined results. In external asm (e.g.
yasm), you do this by using:
-cglobal functon_name, num_args, num_regs, num_xmm_regs
+cglobal function_name, num_args, num_regs, num_xmm_regs
In inline asm, you specify clobbered registers at the end of your asm:
__asm__(".." ::: "%eax").
If gcc is not set to support sse (-msse) it will not accept xmm registers
@section Darwin (OS X, iPhone)
The toolchain provided with Xcode is sufficient to build the basic
-unacelerated code.
+unaccelerated code.
OS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{git://git.libav.org/gas-preprocessor.git} to build the optimized
pacman -S mingw-w64-x86_64-yasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL
@end example
-To target 32bit replace the @code{x86_64} with @code{i686} in the command above.
+To target 32 bits replace @code{x86_64} with @code{i686} in the command above.
@section Microsoft Visual C++ or Intel C++ Compiler for Windows
/ \
special converter [Input to YUV converter]
| |
- | (8bit YUV 4:4:4 / 4:2:2 / 4:2:0 / 4:0:0 )
+ | (8-bit YUV 4:4:4 / 4:2:2 / 4:2:0 / 4:0:0 )
| |
| v
| Horizontal scaler
| |
- | (15bit YUV 4:4:4 / 4:2:2 / 4:2:0 / 4:1:1 / 4:0:0 )
+ | (15-bit YUV 4:4:4 / 4:2:2 / 4:2:0 / 4:1:1 / 4:0:0 )
| |
| v
| Vertical scaler and output converter
-This is a quick description of the viterbi aka dynamic programing
-algorthm.
+This is a quick description of the Viterbi aka dynamic programming
+algorithm.
-Its reason for existence is that wikipedia has become very poor on
+Its reason for existence is that Wikipedia has become very poor on
describing algorithms in a way that makes it useable for understanding
them or anything else actually. It tends now to describe the very same
algorithm under 50 different names and pages with few understandable
Our goal is to find a path from left to right through it which
minimizes the sum of the score of all edges.
(and of course left/right is just a convention here it could be top down too)
-Similarly the minimum could be the maximum by just fliping the sign,
+Similarly the minimum could be the maximum by just flipping the sign,
Example of a path with scores:
O O O O O O O
O O O O O O-1-O---> (sum here is 24)
-The viterbi algorthm now solves this simply column by column
+The Viterbi algorithm now solves this simply column by column
For the previous column each point has a best path and a associated
score:
O 0 4
-the viterbi algorthm continues exactly like this column for column until the
+the Viterbi algorithm continues exactly like this column for column until the
end and then just picks the path with the best score (above that would be the
one with score 3)
-Author: Michael niedermayer
+Author: Michael Niedermayer
Copyright LGPL
avpriv_request_sample(ac->avctx, "SSR");
return AVERROR_PATCHWELCOME;
}
- // I see no textual basis in the spec for this occuring after SSR gain
- // control, but this is what both reference and real implmentations do
+ // I see no textual basis in the spec for this occurring after SSR gain
+ // control, but this is what both reference and real implementations do
if (tns->present && er_syntax)
if (decode_tns(ac, tns, gb, ics) < 0)
return AVERROR_INVALIDDATA;
struct LATMContext {
AACContext aac_ctx; ///< containing AACContext
- int initialized; ///< initilized after a valid extradata was seen
+ int initialized; ///< initialized after a valid extradata was seen
// parser data
int audio_mux_version_A; ///< LATM syntax version
/** Places SBR in pure upsampling mode. */
static void sbr_turnoff(SpectralBandReplication *sbr) {
sbr->start = 0;
- // Init defults used in pure upsampling mode
+ // Init defaults used in pure upsampling mode
sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
sbr->m[1] = 0;
// Reset values for first SBR header
sub x10, x10, #4<<2
b.gt 1b
-// comuting samples[16]
+// computing samples[16]
add x6, x1, #32<<2
ld1 {v0.2s}, [x6], x9
ld1 {v1.2s}, [x0], x9
/*
* Autodesk RLE Decoder
- * Copyright (C) 2005 the ffmpeg project
+ * Copyright (C) 2005 The FFmpeg project
*
* This file is part of Libav.
*
/*
- * Copyright (c) 2001-2003 The ffmpeg Project
+ * Copyright (c) 2001-2003 The FFmpeg project
*
* first version by Francois Revol (revol@free.fr)
* fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
/*
- * Copyright (c) 2001-2003 The ffmpeg Project
+ * Copyright (c) 2001-2003 The FFmpeg project
*
* This file is part of Libav.
*
/*
- * Copyright (c) 2001-2003 The ffmpeg Project
+ * Copyright (c) 2001-2003 The FFmpeg project
*
* This file is part of Libav.
*
/*
- * Copyright (c) 2001-2003 The ffmpeg Project
+ * Copyright (c) 2001-2003 The FFmpeg project
*
* This file is part of Libav.
*
/*
- * Copyright (c) 2001-2003 The ffmpeg Project
+ * Copyright (c) 2001-2003 The FFmpeg project
*
* first version by Francois Revol (revol@free.fr)
* fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
* passed through the extradata[_size] fields. This atom is tacked onto
* the end of an 'alac' stsd atom and has the following format:
*
- * 32bit atom size
- * 32bit tag ("alac")
- * 32bit tag version (0)
- * 32bit samples per frame (used when not set explicitly in the frames)
- * 8bit compatible version (0)
- * 8bit sample size
- * 8bit history mult (40)
- * 8bit initial history (14)
- * 8bit rice param limit (10)
- * 8bit channels
- * 16bit maxRun (255)
- * 32bit max coded frame size (0 means unknown)
- * 32bit average bitrate (0 means unknown)
- * 32bit samplerate
+ * 32 bits atom size
+ * 32 bits tag ("alac")
+ * 32 bits tag version (0)
+ * 32 bits samples per frame (used when not set explicitly in the frames)
+ * 8 bits compatible version (0)
+ * 8 bits sample size
+ * 8 bits history mult (40)
+ * 8 bits initial history (14)
+ * 8 bits rice param limit (10)
+ * 8 bits channels
+ * 16 bits maxRun (255)
+ * 32 bits max coded frame size (0 means unknown)
+ * 32 bits average bitrate (0 means unknown)
+ * 32 bits samplerate
*/
#include <inttypes.h>
skip_bits_long(&gb, 32); // sample rate already known
sconf->samples = get_bits_long(&gb, 32);
avctx->channels = m4ac.channels;
- skip_bits(&gb, 16); // number of channels already knwon
+ skip_bits(&gb, 16); // number of channels already known
skip_bits(&gb, 3); // skip file_type
sconf->resolution = get_bits(&gb, 3);
sconf->floating = get_bits1(&gb);
* @param p the context
* @param subframe unpacked amr subframe
* @param mode mode of the current frame
- * @param fixed_sparse sparse respresentation of the fixed vector
+ * @param fixed_sparse sparse representation of the fixed vector
*/
static void pitch_sharpening(AMRContext *p, int subframe, enum Mode mode,
AMRFixed *fixed_sparse)
{
// The spec suggests the current pitch gain is always used, but in other
- // modes the pitch and codebook gains are joinly quantized (sec 5.8.2)
+ // modes the pitch and codebook gains are jointly quantized (sec 5.8.2)
// so the codebook gain cannot depend on the quantized pitch gain.
if (mode == MODE_12k2)
p->beta = FFMIN(p->pitch_gain[4], 1.0);
#define MIN_ISF_SPACING (128.0 / 32768.0) ///< minimum isf gap
#define PRED_FACTOR (1.0 / 3.0)
-#define MIN_ENERGY -14.0 ///< initial innnovation energy (dB)
+#define MIN_ENERGY -14.0 ///< initial innovation energy (dB)
#define ENERGY_MEAN 30.0 ///< mean innovation energy (dB) in all modes
#define PREEMPH_FAC 0.68 ///< factor used to de-emphasize synthesis
s->y = s->nb_args > 0 ? av_clip((s->args[0] - 1)*s->font_height, 0, avctx->height - s->font_height) : 0;
s->x = s->nb_args > 1 ? av_clip((s->args[1] - 1)*FONT_WIDTH, 0, avctx->width - FONT_WIDTH) : 0;
break;
- case 'h': //set creen mode
+ case 'h': //set screen mode
case 'l': //reset screen mode
if (s->nb_args < 2)
s->args[0] = DEFAULT_SCREEN_MODE;
}
/**
- * Calculate culmulative frequency for next symbol. Does NO update!
+ * Calculate cumulative frequency for next symbol. Does NO update!
* @param ctx decoder context
* @param tot_f is the total frequency or (code_value)1<<shift
- * @return the culmulative frequency
+ * @return the cumulative frequency
*/
static inline int range_decode_culfreq(APEContext *ctx, int tot_f)
{
DAT4 .req v5
DAT5 .req v6
DAT6 .req sl // use these rather than the otherwise unused
-DAT7 .req fp // ip and lr so that we can load them usinf LDRD
+DAT7 .req fp // ip and lr so that we can load them using LDRD
.macro output4words tail, head, r0, r1, r2, r3, r4, r5, r6, r7, pointer_dead=0
.if \head
#ifdef ENABLE_ARM_TESTS
/**
- * h263 dequantizer supplementary function, it is performance critical and needs to
+ * H.263 dequantizer supplementary function, it is performance critical and needs to
* have optimized implementations for each architecture. Is also used as a reference
* implementation in regression tests
*/
__row_loop:
- @@ read the row and check if it is null, almost null, or not, according to strongarm specs, it is not necessary to optimize ldr accesses (i.e. split 32bits in 2 16bits words), at least it gives more usable registers :)
+ @@ read the row and check if it is null, almost null, or not, according to strongarm specs, it is not necessary to optimize ldr accesses (i.e. split 32 bits in two 16-bit words), at least it gives more usable registers :)
ldr r1, [r14, #0] @ R1=(int32)(R12)[0]=ROWr32[0] (relative row cast to a 32b pointer)
ldr r2, [r14, #4] @ R2=(int32)(R12)[1]=ROWr32[1]
ldr r3, [r14, #8] @ R3=ROWr32[2]
@@ row[7] = (a0 - b0) >> ROW_SHIFT;
add r8, r6, r0 @ R8=a0+b0
add r9, r2, r1 @ R9=a1+b1
- @@ put 2 16 bits half-words in a 32bits word
- @@ ROWr32[0]=ROWr16[0] | (ROWr16[1]<<16) (only Little Endian compliant then!!!)
+ @@ put two 16-bit half-words in a 32-bit word
+ @@ ROWr32[0]=ROWr16[0] | (ROWr16[1]<<16) (only little-endian compliant then!!!)
ldr r10, =MASK_MSHW @ R10=0xFFFF0000
and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a1+b1)<<5)
mvn r11, r10 @ R11= NOT R10= 0x0000FFFF
vmov.i16 q12, #3
vsubl.s8 q10, d8, d6 @ QS0 - PS0
- vsubl.s8 q11, d9, d7 @ (widened to 16bit)
+ vsubl.s8 q11, d9, d7 @ (widened to 16 bits)
veor q2, q2, q13 @ PS1 = P1 ^ 0x80
veor q5, q5, q13 @ QS1 = Q1 ^ 0x80
vmul.i16 q10, q10, q12 @ w = 3 * (QS0 - PS0)
/*
- * SSA/ASS common funtions
+ * SSA/ASS common functions
* Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org>
*
* This file is part of Libav.
/*
- * SSA/ASS common funtions
+ * SSA/ASS common functions
* Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org>
*
* This file is part of Libav.
*/
static const uint8_t specs_per_bfu[52] = {
8, 8, 8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 6, // low band
- 6, 6, 6, 6, 7, 7, 7, 7, 9, 9, 9, 9, 10, 10, 10, 10, // midle band
+ 6, 6, 6, 6, 7, 7, 7, 7, 9, 9, 9, 9, 10, 10, 10, 10, // middle band
12, 12, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20, 20, 20, 20 // high band
};
* Use only bitexact stuff (except (I)DCT).
*/
#define AV_CODEC_FLAG_BITEXACT (1 << 23)
-/* Fx : Flag for h263+ extra options */
+/* Fx : Flag for H.263+ extra options */
/**
* H.263 advanced intra coding / MPEG-4 AC prediction
*/
* are connected to a parser to split what they return into proper frames.
* This flag is reserved to the very rare category of codecs which have a
* bitstream that cannot be split into frames without timeconsuming
- * operations like full decoding. Demuxers carring such bitstreams thus
+ * operations like full decoding. Demuxers carrying such bitstreams thus
* may return multiple frames in a packet. This has many disadvantages like
* prohibiting stream copy in many cases thus it should only be considered
* as a last resort.
#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay.
#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe.
#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
+/* Fx : Flag for H.263+ extra options */
#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
#define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter
#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
* are connected to a parser to split what they return into proper frames.
* This flag is reserved to the very rare category of codecs which have a
* bitstream that cannot be split into frames without timeconsuming
- * operations like full decoding. Demuxers carring such bitstreams thus
+ * operations like full decoding. Demuxers carrying such bitstreams thus
* may return multiple frames in a packet. This has many disadvantages like
* prohibiting stream copy in many cases thus it should only be considered
* as a last resort.
#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
#define MB_TYPE_QUANT 0x00010000
#define MB_TYPE_CBP 0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
+// Note bits 24-31 are reserved for codec specific use (H.264 ref0, MPEG-1 0mv, ...)
#endif
/**
/**
* some codecs need / can use extradata like Huffman tables.
- * mjpeg: Huffman tables
+ * MJPEG: Huffman tables
* rv10: additional flags
- * mpeg4: global headers (they can be in the bitstream or here)
+ * MPEG-4: global headers (they can be in the bitstream or here)
* The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
- * than extradata_size to avoid prolems if it is read with the bitstream reader.
+ * than extradata_size to avoid problems if it is read with the bitstream reader.
* The bytewise contents of extradata must not depend on the architecture or CPU endianness.
* - encoding: Set/allocated/freed by libavcodec.
* - decoding: Set/allocated/freed by user.
* picture width / height.
*
* @note Those fields may not match the values of the last
- * AVFrame outputted by avcodec_decode_video2 due frame
+ * AVFrame output by avcodec_decode_video2 due frame
* reordering.
*
* - encoding: MUST be set by user.
* the decoded frame is cropped before being output.
*
* @note Those field may not match the value of the last
- * AVFrame outputted by avcodec_receive_frame() due frame
+ * AVFrame output by avcodec_receive_frame() due frame
* reordering.
*
* - encoding: unused
/**
* Pixel format, see AV_PIX_FMT_xxx.
* May be set by the demuxer if known from headers.
- * May be overriden by the decoder if it knows better.
+ * May be overridden by the decoder if it knows better.
*
* @note This field may not match the value of the last
- * AVFrame outputted by avcodec_receive_frame() due frame
+ * AVFrame output by avcodec_receive_frame() due frame
* reordering.
*
* - encoding: Set by user.
#endif
/**
- * qscale factor between P and I-frames
- * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
+ * qscale factor between P- and I-frames
+ * If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset).
* If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
* - encoding: Set by user.
* - decoding: unused
*/
int slice_flags;
#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
+#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics)
#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
#if FF_API_XVMC
#endif
/**
- * minimum MB lagrange multipler
+ * minimum MB Lagrange multiplier
* - encoding: Set by user.
* - decoding: unused
*/
int mb_lmin;
/**
- * maximum MB lagrange multipler
+ * maximum MB Lagrange multiplier
* - encoding: Set by user.
* - decoding: unused
*/
* to all data planes. data[] must hold as many pointers as it can.
* extended_data must be allocated with av_malloc() and will be freed in
* av_frame_unref().
- * * otherwise exended_data must point to data
+ * * otherwise extended_data must point to data
* - buf[] must contain one or more pointers to AVBufferRef structures. Each of
* the frame's data and extended_data pointers must be contained in these. That
* is, one AVBufferRef for each allocated chunk of memory, not necessarily one
#define FF_BUG_TRUNCATED 16384
/**
- * strictly follow the standard (MPEG4, ...).
+ * strictly follow the standard (MPEG-4, ...).
* - encoding: Set by user.
* - decoding: Set by user.
* Setting this to STRICT or higher means the encoder and decoder will
*/
attribute_deprecated
int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
+#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 // visualize forward predicted MVs of P-frames
+#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 // visualize forward predicted MVs of B-frames
+#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 // visualize backward predicted MVs of B-frames
#endif
/**
#define AV_EF_EXPLODE (1<<3)
/**
- * opaque 64bit number (generally a PTS) that will be reordered and
+ * opaque 64-bit number (generally a PTS) that will be reordered and
* output in AVFrame.reordered_opaque
* - encoding: unused
* - decoding: Set by user.
int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
/**
- * noise vs. sse weight for the nsse comparsion function
+ * noise vs. sse weight for the nsse comparison function
* - encoding: Set by user.
* - decoding: unused
*/
/**
* 0 terminated ASS/SSA compatible event line.
- * The pressentation of this is unaffected by the other values in this
+ * The presentation of this is unaffected by the other values in this
* struct.
*/
char *ass;
* next call to this function or until closing or flushing the
* decoder. The caller may not write to it.
*
- * @param[in] avpkt The input AVpacket containing the input buffer.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
* You can create such packet with av_init_packet() and by then setting
* data and size, some decoders might in addition need other fields like
* flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
* a pointer to an AVClass struct
* @param[in] feature string containing the name of the missing feature
* @param[in] want_sample indicates if samples are wanted which exhibit this feature.
- * If want_sample is non-zero, additional verbage will be added to the log
+ * If want_sample is non-zero, additional verbiage will be added to the log
* message which tells the user how to report samples to the development
* mailing list.
* @deprecated Use avpriv_report_missing_feature() instead.
}
/**
- * Caclulate quantization tables for version b
+ * Calculate quantization tables for version b
*/
static av_cold void binkb_calc_quant(void)
{
/**
* Build VLC decoding tables suitable for use with get_vlc().
*
- * @param vlc the context to be initted
+ * @param vlc the context to be initialized
*
* @param table_nb_bits max length of vlc codes to store directly in this table
* (Longer codes are delegated to subtables.)
/* Build VLC decoding tables suitable for use with get_vlc().
- 'nb_bits' set thee decoding table size (2^nb_bits) entries. The
+ 'nb_bits' sets the decoding table size (2^nb_bits) entries. The
bigger it is, the faster is the decoding. But it should not be too
big to save memory and L1 cache. '9' is a good compromise.
#include "avcodec.h"
/**
- * Called by the biststream filters to get the next packet for filtering.
+ * Called by the bitstream filters to get the next packet for filtering.
* The filter is responsible for either freeing the packet or passing it to the
* caller.
*/
/*
* Cinepak Video Decoder
- * Copyright (C) 2003 the ffmpeg project
+ * Copyright (C) 2003 The FFmpeg project
*
* This file is part of Libav.
*
VLC envelope_quant_index[13];
VLC sqvh[7]; // scalar quantization
- /* generatable tables and related variables */
+ /* generate tables and related variables */
int gain_size_factor;
float gain_table[23];
/* Initialize variable relations */
q->subpacket[s].numvector_size = (1 << q->subpacket[s].log2_numvector_size);
- /* Try to catch some obviously faulty streams, othervise it might be exploitable */
+ /* Try to catch some obviously faulty streams, otherwise it might be exploitable */
if (q->subpacket[s].total_subbands > 53) {
avpriv_request_sample(avctx, "total_subbands > 53");
return AVERROR_PATCHWELCOME;
q->saturate_output = saturate_output_float;
}
- /* Try to catch some obviously faulty streams, othervise it might be exploitable */
+ /* Try to catch some obviously faulty streams, otherwise it might be exploitable */
if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
q->samples_per_channel != 1024) {
avpriv_request_sample(avctx, "samples_per_channel = %d",
/**
* @file
- * Cook AKA RealAudio G2 compatible decoderdata
+ * Cook AKA RealAudio G2 compatible decoder data
*/
#ifndef AVCODEC_COOKDATA_H
* based on "Creative YUV (CYUV) stream format for AVI":
* http://www.csse.monash.edu.au/~timf/videocodec/cyuv.txt
*
- * Copyright (C) 2003 the ffmpeg project
+ * Copyright (C) 2003 The FFmpeg project
*
* This file is part of Libav.
*
/* ADPCM data */
-/* 16bits signed fractional Q13 binary codes */
+/* 16 bits signed fractional Q13 binary codes */
const int16_t ff_dca_adpcm_vb[4096][4] = {
{ 9928, -2618, -1093, -1263 },
{ 11077, -2876, -1747, -308 },
5011872, 5688529, 6456542, 7328245, 8317638, 0, 0, 0
};
-/* 20bits unsigned fractional binary codes */
+/* 20 bits unsigned fractional binary codes */
const uint32_t ff_dca_lossy_quant[32] = {
0, 6710886, 4194304, 3355443, 2474639, 2097152, 1761608, 1426063,
796918, 461373, 251658, 146801, 79692, 46137, 27263, 16777,
84, 42, 21, 0, 0, 0, 0, 0
};
-/* 20bits unsigned fractional binary codes */
+/* 20 bits unsigned fractional binary codes */
const uint32_t ff_dca_lossless_quant[32] = {
0, 4194304, 2097152, 1384120, 1048576, 696254, 524288, 348127,
262144, 131072, 65431, 33026, 16450, 8208, 4100, 2049,
ff_dlog(s->avctx, "\n");
}
} else {
- av_log(avctx, AV_LOG_ERROR, "Non standard configuration %d !\n", s->amode);
+ av_log(avctx, AV_LOG_ERROR, "Nonstandard configuration %d !\n", s->amode);
return AVERROR_INVALIDDATA;
}
printf("dct-test [-i] [<test-number>]\n"
"test-number 0 -> test with random matrixes\n"
" 1 -> test with random sparse matrixes\n"
- " 2 -> do 3. test from mpeg4 std\n"
+ " 2 -> do 3. test from MPEG-4 std\n"
"-i test IDCT implementations\n"
"-4 test IDCT248 implementations\n"
"-t speed test\n");
const uint8_t *ac_run_flag, *ac_index_flag;
const uint16_t *run_codes;
const uint8_t *run_bits, *run;
- int bit_rates[5]; ///< Helpher to choose variants, rounded to nearest 5Mb/s
+ int bit_rates[5]; ///< Helper to choose variants, rounded to nearest 5Mb/s
} CIDEntry;
extern const CIDEntry ff_dnxhd_cid_table[];
#include "pixblockdsp.h"
#include "dnxhdenc.h"
-// The largest value that will not lead to overflow for 10bit samples.
+// The largest value that will not lead to overflow for 10-bit samples.
#define DNX10BIT_QMAT_SHIFT 18
#define RC_VARIANCE 1 // use variance or ssd for fast rc
#define LAMBDA_FRAC_BITS 10
/*
* Assorted DPCM codecs
- * Copyright (c) 2003 The ffmpeg Project
+ * Copyright (c) 2003 The FFmpeg project
*
* This file is part of Libav.
*
/*
- * DXVA2 H264 HW acceleration.
+ * DXVA2 H.264 HW acceleration.
*
* copyright (c) 2009 Laurent Aimar
*
#include "mpeg12vlc.h"
#define EA_PREAMBLE_SIZE 8
-#define MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD i-frame */
-#define MADm_TAG MKTAG('M', 'A', 'D', 'm') /* MAD p-frame */
+#define MADk_TAG MKTAG('M', 'A', 'D', 'k') /* MAD I-frame */
+#define MADm_TAG MKTAG('M', 'A', 'D', 'm') /* MAD P-frame */
#define MADe_TAG MKTAG('M', 'A', 'D', 'e') /* MAD lqp-frame */
typedef struct MadContext {
#include "elbg.h"
#include "avcodec.h"
-#define DELTA_ERR_MAX 0.1 ///< Precision of the ELBG algorithm (as percentual error)
+#define DELTA_ERR_MAX 0.1 ///< Precision of the ELBG algorithm (as percentage error)
/**
* In the ELBG jargon, a cell is the set of points that are closest to a
/**
* Add the points in the low utility cell to its closest cell. Split the high
- * utility cell, putting the separed points in the (now empty) low utility
+ * utility cell, putting the separated points in the (now empty) low utility
* cell.
*
* @param elbg Internal elbg data
s->mv[0][0][1] = s->cur_pic.motion_val[dir][mb_x * 2 + mb_y * 2 * s->b8_stride][1];
}
- s->decode_mb(s->opaque, 0 /* FIXME h264 partitioned slices need this set */,
+ s->decode_mb(s->opaque, 0 /* FIXME H.264 partitioned slices need this set */,
mv_dir, mv_type, &s->mv, mb_x, mb_y, 0, 0);
}
}
AVFrame *f;
ThreadFrame *tf;
- // it's the caller responsability to allocate these buffers
+ // it is the caller's responsibility to allocate these buffers
int16_t (*motion_val[2])[2];
int8_t *ref_index[2];
mantissa <<= 1;
exp -= (1 << 23);
}
- // clamp the mantissa to 10-bits
+ // clamp the mantissa to 10 bits
mantissa &= ((1 << 10) - 1);
- // shift left to generate single-precision mantissa of 23-bits
+ // shift left to generate single-precision mantissa of 23 bits
mantissa <<= 13;
}
} else {
- // shift left to generate single-precision mantissa of 23-bits
+ // shift left to generate single-precision mantissa of 23 bits
mantissa <<= 13;
// generate single precision biased exponent value
exp = (exp << 13) + HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP;
}
}
- // allocate thread data, used for non EXR_RAW compreesion types
+ // allocate thread data, used for non EXR_RAW compression types
s->thread_data = av_mallocz_array(avctx->thread_count, sizeof(EXRThreadData));
if (!s->thread_data)
return AVERROR_INVALIDDATA;
static int decode_init_thread_copy(AVCodecContext *avctx)
{ EXRContext *s = avctx->priv_data;
- // allocate thread data, used for non EXR_RAW compreesion types
+ // allocate thread data, used for non EXR_RAW compression types
s->thread_data = av_mallocz_array(avctx->thread_count, sizeof(EXRThreadData));
if (!s->thread_data)
return AVERROR_INVALIDDATA;
#include "tiff.h"
/**
- * initialize upacker code
+ * initialize unpacker code
*/
void ff_ccitt_unpack_init(void);
/*
* FLI/FLC Animation Video Decoder
- * Copyright (C) 2003, 2004 the ffmpeg project
+ * Copyright (C) 2003, 2004 The FFmpeg project
*
* This file is part of Libav.
*
case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break;
case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break;
- case 24 : avctx->pix_fmt = AV_PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */
+ case 24 : avctx->pix_fmt = AV_PIX_FMT_BGR24; /* Supposedly BGR, but no files to test with */
av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
return AVERROR_PATCHWELCOME;
default :
/* Should not get here, ever as the pix_fmt is processed */
/* in flic_decode_init and the above if should deal with */
- /* the finite set of possibilites allowable by here. */
+ /* the finite set of possibilities allowable by here. */
/* But in case we do, just error out. */
av_log(avctx, AV_LOG_ERROR, "Unknown FLC format, my science cannot explain how this happened.\n");
return AVERROR_BUG;
avpriv_align_put_bits(&s->pb);
put_bits(&s->pb, 17, 1);
- /* 0: h263 escape codes 1: 11-bit escape codes */
+ /* 0: H.263 escape codes 1: 11-bit escape codes */
put_bits(&s->pb, 5, (s->h263_flv - 1));
put_bits(&s->pb, 8,
(((int64_t) s->picture_number * 30 * s->avctx->time_base.num) / // FIXME use timestamp
}
/**
- * Peform residual interpolation based on frame classification.
+ * Perform residual interpolation based on frame classification.
*
* @param buf decoded excitation vector
* @param out output vector
p->interp_index = comp_interp_index(p, p->pitch_lag[1],
&p->sid_gain, &p->cur_gain);
- /* Peform pitch postfiltering */
+ /* Perform pitch postfiltering */
if (p->postfilter) {
i = PITCH_MAX;
for (j = 0; j < SUBFRAMES; i += SUBFRAME_LEN, j++)
#include "put_bits.h"
/**
- * G.726 11bit float.
- * G.726 Standard uses rather odd 11bit floating point arithmentic for
+ * G.726 11-bit float.
+ * G.726 Standard uses rather odd 11-bit floating point arithmetic for
* numerous occasions. It's a mystery to me why they did it this way
- * instead of simply using 32bit integer arithmetic.
+ * instead of simply using 32-bit integer arithmetic.
*/
typedef struct Float11 {
- uint8_t sign; /**< 1bit sign */
- uint8_t exp; /**< 4bit exponent */
- uint8_t mant; /**< 6bit mantissa */
+ uint8_t sign; /**< 1 bit sign */
+ uint8_t exp; /**< 4 bits exponent */
+ uint8_t mant; /**< 6 bits mantissa */
} Float11;
static inline Float11* i2f(int i, Float11* f)
int code_size;
} G726Context;
-static const int quant_tbl16[] = /**< 16kbit/s 2bits per sample */
+static const int quant_tbl16[] = /**< 16kbit/s 2 bits per sample */
{ 260, INT_MAX };
static const int16_t iquant_tbl16[] =
{ 116, 365, 365, 116 };
static const uint8_t F_tbl16[] =
{ 0, 7, 7, 0 };
-static const int quant_tbl24[] = /**< 24kbit/s 3bits per sample */
+static const int quant_tbl24[] = /**< 24kbit/s 3 bits per sample */
{ 7, 217, 330, INT_MAX };
static const int16_t iquant_tbl24[] =
{ INT16_MIN, 135, 273, 373, 373, 273, 135, INT16_MIN };
static const uint8_t F_tbl24[] =
{ 0, 1, 2, 7, 7, 2, 1, 0 };
-static const int quant_tbl32[] = /**< 32kbit/s 4bits per sample */
+static const int quant_tbl32[] = /**< 32kbit/s 4 bits per sample */
{ -125, 79, 177, 245, 299, 348, 399, INT_MAX };
static const int16_t iquant_tbl32[] =
{ INT16_MIN, 4, 135, 213, 273, 323, 373, 425,
static const uint8_t F_tbl32[] =
{ 0, 0, 0, 1, 1, 1, 3, 7, 7, 3, 1, 1, 1, 0, 0, 0 };
-static const int quant_tbl40[] = /**< 40kbit/s 5bits per sample */
+static const int quant_tbl40[] = /**< 40kbit/s 5 bits per sample */
{ -122, -16, 67, 138, 197, 249, 297, 338,
377, 412, 444, 474, 501, 527, 552, INT_MAX };
static const int16_t iquant_tbl40[] =
/**
- * Para 4.2.2 page 18: Adaptive quantizer.
+ * Paragraph 4.2.2 page 18: Adaptive quantizer.
*/
static inline uint8_t quant(G726Context* c, int d)
{
}
/**
- * Para 4.2.3 page 22: Inverse adaptive quantizer.
+ * Paragraph 4.2.3 page 22: Inverse adaptive quantizer.
*/
static inline int16_t inverse_quant(G726Context* c, int i)
{
int dql, dex, dqt;
dql = c->tbls.iquant[i] + (c->y >> 2);
- dex = (dql>>7) & 0xf; /* 4bit exponent */
+ dex = (dql>>7) & 0xf; /* 4-bit exponent */
dqt = (1<<7) + (dql & 0x7f); /* log2 -> linear */
return (dql < 0) ? 0 : ((dqt<<dex) >> 7);
}
*
* GET_CACHE(name, gb)
* Will output the contents of the internal cache,
- * next bit is MSB of 32 or 64 bit (FIXME 64bit).
+ * next bit is MSB of 32 or 64 bits (FIXME 64 bits).
*
* SHOW_UBITS(name, gb, num)
* Will return the next num bits.
}
/**
- * read mpeg1 dc style vlc (sign bit + mantisse with no MSB).
+ * Read MPEG-1 dc-style VLC (sign bit + mantisse with no MSB).
* if MSB not set it is negative
* @param n length in bits
*/
/*
- * H261 common code
+ * H.261 common code
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2004 Maarten Daniels
*
/**
* @file
- * h261codec.
+ * H.261 codec
*/
#include "avcodec.h"
/*
- * H261 decoder
+ * H.261 codec
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2004 Maarten Daniels
*
/**
* @file
- * h261codec.
+ * H.261 codec.
*/
#ifndef AVCODEC_H261_H
/*
- * H261 parser
+ * H.261 parser
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2004 Maarten Daniels
*
/**
* @file
- * h261codec.
+ * H.261 parser
*/
#include "parser.h"
/*
- * H261 decoder
+ * H.261 decoder
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2004 Maarten Daniels
*
init_get_bits(&s->gb, buf, buf_size * 8);
if (!s->context_initialized)
- // we need the IDCT permutaton for reading a custom matrix
+ // we need the IDCT permutation for reading a custom matrix
ff_mpv_idct_init(s);
ret = h261_decode_picture_header(h);
/*
- * H261 encoder
+ * H.261 encoder
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2004 Maarten Daniels
*
/*
- * H263/MPEG4 backend for encoder and decoder
+ * H.263/MPEG-4 backend for encoder and decoder
* Copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support.
+ * H.263+ support.
* Copyright (c) 2001 Juan J. Sierralta P
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * h263/mpeg4 codec.
+ * H.263/MPEG-4 codec.
*/
#include <limits.h>
A = mot_val[ - 1];
/* special case for first (slice) line */
if (s->first_slice_line && block<3) {
- // we can't just change some MVs to simulate that as we need them for the B frames (and ME)
+ // we can't just change some MVs to simulate that as we need them for the B-frames (and ME)
// and if we ever support non rectangular objects than we need to do a few ifs here anyway :(
if(block==0){ //most common case
if(s->mb_x == s->resync_mb_x){ //rare
/*
- * H263 internal header
+ * H.263 internal header
*
* This file is part of Libav.
*
int16_t block[6][64]);
/**
- * Return the value of the 3bit "source format" syntax element.
+ * Return the value of the 3-bit "source format" syntax element.
* This represents some standard picture dimensions or indicates that
* width&height are explicitly stored later.
*/
/*
- * H263+ tables
+ * H.263+ tables
*
* This file is part of Libav.
*
/*
* copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support
+ * H.263+ support
* copyright (c) 2001 Juan J. Sierralta P
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
}
s->codec_id = avctx->codec->id;
- /* for h263, we allocate the images after having read the header */
+ /* for H.263, we allocate the images after having read the header */
if (avctx->codec->id != AV_CODEC_ID_H263 &&
avctx->codec->id != AV_CODEC_ID_MPEG4) {
avctx->pix_fmt = h263_get_format(avctx);
return ret;
if (!s->context_initialized)
- // we need the idct permutaton for reading a custom matrix
+ // we need the idct permutation for reading a custom matrix
ff_mpv_idct_init(s);
/* let's go :-) */
SET_QPEL_FUNC(qpel_pixels_tab[1][15], qpel8_mc33_old_c)
}
- /* After H263 & mpeg4 header decode we have the height, width,
+ /* After H.263 & MPEG-4 header decode we have the height, width,
* and other parameters. So then we could init the picture.
- * FIXME: By the way H263 decoder is evolving it should have
+ * FIXME: By the way H.263 decoder is evolving it should have
* an H263EncContext */
if (s->width != avctx->coded_width ||
s->height != avctx->coded_height ||
/**
* @file
- * H.264 / AVC / MPEG4 part10 codec.
+ * H.264 / AVC / MPEG-4 part10 codec.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 codec.
+ * H.264 / AVC / MPEG-4 part10 codec.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
DECLARE_ALIGNED(8, uint16_t, sub_mb_type)[4];
- ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
+ ///< as a DCT coefficient is int32_t in high depth, we need to reserve twice the space.
DECLARE_ALIGNED(16, int16_t, mb)[16 * 48 * 2];
DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2];
///< as mb is addressed by scantable[i] and scantable is uint8_t we can either
H2645Packet pkt;
- int pixel_shift; ///< 0 for 8-bit H264, 1 for high-bit-depth H264
+ int pixel_shift; ///< 0 for 8-bit H.264, 1 for high-bit-depth H.264
/* coded dimensions -- 16 * mb w/h */
int width, height;
int nal_unit_type;
/**
- * Used to parse AVC variant of h264
+ * Used to parse AVC variant of H.264
*/
int is_avc; ///< this flag is != 0 if codec is avc1
int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4)
* @{
*/
/**
- * current slice number, used to initalize slice_num of each thread/context
+ * current slice number, used to initialize slice_num of each thread/context
*/
int current_slice;
int temporal_id;
/**
- * H264 only, nal_ref_idc
+ * H.264 only, nal_ref_idc
*/
int ref_idc;
} H2645NAL;
/**
* @file
- * H.264 / AVC / MPEG4 part10 cabac decoding.
+ * H.264 / AVC / MPEG-4 part10 cabac decoding.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
{ 2, 54 }, { 3, 74 }, { -28,127 }, { -23, 104 },
{ -6, 53 }, { -1, 54 }, { 7, 51 },
- /* 11 - 23 unsused for I */
+ /* 11 - 23 unused for I */
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
/**
* @file
- * H.264 / AVC / MPEG4 part10 cavlc bitstream decoding.
+ * H.264 / AVC / MPEG-4 part10 cavlc bitstream decoding.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 direct mb/block decoding.
+ * H.264 / AVC / MPEG-4 part10 direct mb/block decoding.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 loop filter.
+ * H.264 / AVC / MPEG-4 part10 loop filter.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 macroblock decoding
+ * H.264 / AVC / MPEG-4 part10 macroblock decoding
*/
#include <stdint.h>
/**
* Wait until all reference frames are available for MC operations.
*
- * @param h the H264 context
+ * @param h the H.264 context
*/
static void await_references(const H264Context *h, H264SliceContext *sl)
{
/*
- * H.26L/H.264/AVC/JVT/14496-10/... motion vector predicion
+ * H.26L/H.264/AVC/JVT/14496-10/... motion vector prediction
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of Libav.
/**
* @file
- * H.264 / AVC / MPEG4 part10 motion vector predicion.
+ * H.264 / AVC / MPEG-4 part10 motion vector prediction.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
int chroma_log2_weight_denom;
int luma_weight_flag[2]; ///< 7.4.3.2 luma_weight_lX_flag
int chroma_weight_flag[2]; ///< 7.4.3.2 chroma_weight_lX_flag
- // The following 2 can be changed to int8_t but that causes 10cpu cycles speedloss
+ // The following 2 can be changed to int8_t but that causes a 10 CPU cycles speed loss
int luma_weight[48][2][2];
int chroma_weight[48][2][2][2];
int implicit_weight[48][48][2];
/**
* @file
- * H.264 / AVC / MPEG4 part10 parser.
+ * H.264 / AVC / MPEG-4 part10 parser.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 codec.
+ * H.264 / AVC / MPEG-4 part10 codec.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 parameter set decoding.
+ * H.264 / AVC / MPEG-4 part10 parameter set decoding.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 reference picture handling.
+ * H.264 / AVC / MPEG-4 part10 reference picture handling.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
av_log(h->avctx, AV_LOG_DEBUG, "mmco: unref long failure\n");
break;
case MMCO_LONG:
- // Comment below left from previous code as it is an interresting note.
+ // Comment below left from previous code as it is an interesting note.
/* First field in pair is in short term list or
* at a different long term index.
* This is not allowed; see 7.4.3.3, notes 2 and 3.
/*
- * H.26L/H.264/AVC/JVT/14496-10/... sei decoding
+ * H.26L/H.264/AVC/JVT/14496-10/... SEI decoding
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of Libav.
/**
* @file
- * H.264 / AVC / MPEG4 part10 sei decoding.
+ * H.264 / AVC / MPEG-4 part10 SEI decoding.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 codec.
+ * H.264 / AVC / MPEG-4 part10 codec.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
av_fast_malloc(&sl->bipred_scratchpad, &sl->bipred_scratchpad_allocated, 16 * 6 * alloc_size);
// edge emu needs blocksize + filter length - 1
- // (= 21x21 for h264)
+ // (= 21x21 for H.264)
av_fast_malloc(&sl->edge_emu_buffer, &sl->edge_emu_buffer_allocated, alloc_size * 2 * 21);
av_fast_malloc(&sl->top_borders[0], &sl->top_borders_allocated[0],
/**
* Decode a slice header.
- * This will (re)intialize the decoder and call h264_frame_start() as needed.
+ * This will (re)initialize the decoder and call h264_frame_start() as needed.
*
* @param h h264context
*
/**
* @file
- * H.264 / AVC / MPEG4 part10 DSP functions.
+ * H.264 / AVC / MPEG-4 part10 DSP functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/*
- * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
+ * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of Libav.
/**
* @file
* @brief
- * H264 / AVC / MPEG4 part10 codec data table
+ * H.264 / AVC / MPEG-4 part10 codec data table
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 DSP functions.
+ * H.264 / AVC / MPEG-4 part10 DSP functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
int stride, int alpha, int beta);
void (*h264_h_loop_filter_chroma_mbaff_intra)(uint8_t *pix /*align 8*/,
int stride, int alpha, int beta);
- // h264_loop_filter_strength: simd only. the C version is inlined in h264.c
+ // h264_loop_filter_strength: simd only. the C version is inlined in h264_loopfilter.c
void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40],
int8_t ref[2][40], int16_t mv[2][40][2],
int bidir, int edges, int step,
/**
* @file
- * H.264 / AVC / MPEG4 part10 DSP functions.
+ * H.264 / AVC / MPEG-4 part10 DSP functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
/**
* @file
- * H.264 / AVC / MPEG4 part10 prediction functions.
+ * H.264 / AVC / MPEG-4 part10 prediction functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
h->pred16x16[TOP_DC_PRED8x8 ]= FUNCC(pred16x16_top_dc , depth);\
h->pred16x16[DC_128_PRED8x8 ]= FUNCC(pred16x16_128_dc , depth);\
\
- /* special lossless h/v prediction for h264 */ \
+ /* special lossless h/v prediction for H.264 */ \
h->pred4x4_add [VERT_PRED ]= FUNCC(pred4x4_vertical_add , depth);\
h->pred4x4_add [ HOR_PRED ]= FUNCC(pred4x4_horizontal_add , depth);\
h->pred8x8l_add [VERT_PRED ]= FUNCC(pred8x8l_vertical_add , depth);\
/**
* @file
- * H.264 / AVC / MPEG4 prediction functions.
+ * H.264 / AVC / MPEG-4 prediction functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
#define TOP_DC_PRED8x8 5
#define DC_128_PRED8x8 6
-// H264/SVQ3 (8x8) specific
+// H.264/SVQ3 (8x8) specific
#define ALZHEIMER_DC_L0T_PRED8x8 7
#define ALZHEIMER_DC_0LT_PRED8x8 8
#define ALZHEIMER_DC_L00_PRED8x8 9
/**
* @file
- * H.264 / AVC / MPEG4 part10 prediction functions.
+ * H.264 / AVC / MPEG-4 part10 prediction functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
return z_scan_block_avail(s, x0, y0, xA1, yA1);
}
-//check if the two luma locations belong to the same mostion estimation region
+//check if the two luma locations belong to the same motion estimation region
static int isDiffMER(HEVCContext *s, int xN, int yN, int xP, int yP)
{
uint8_t plevel = s->ps.pps->log2_parallel_merge_level;
if (!s->quincunx_subsampling && s->frame_packing_arrangement_type != 5)
skip_bits(gb, 16); // frame[01]_grid_position_[xy]
skip_bits(gb, 8); // frame_packing_arrangement_reserved_byte
- skip_bits1(gb); // frame_packing_arrangement_persistance_flag
+ skip_bits1(gb); // frame_packing_arrangement_persistence_flag
}
skip_bits1(gb); // upsampled_aspect_ratio_flag
return 0;
/*
* id Quake II CIN Video Decoder
- * Copyright (C) 2003 the ffmpeg project
+ * Copyright (C) 2003 The FFmpeg project
*
* This file is part of Libav.
*
int sumLenArr[BANDS]; ///< bits for all coeffs in band
int skipFlagRaw[BANDS]; ///< skip flags are stored in raw form or not
int skipFlagBits[BANDS]; ///< bits used to code skip flags
- int skipFlagCount[BANDS]; ///< skipped coeffients per band
+ int skipFlagCount[BANDS]; ///< skipped coefficients per band
int skipFlags[COEFFS]; ///< skip coefficient decoding or not
int codewords[COEFFS]; ///< raw codewords read from bitstream
/* Some constants for parsing frame bitstream flags. */
-#define BS_8BIT_PEL (1 << 1) ///< 8bit pixel bitdepth indicator
+#define BS_8BIT_PEL (1 << 1) ///< 8-bit pixel bitdepth indicator
#define BS_KEYFRAME (1 << 2) ///< intra frame indicator
#define BS_MV_Y_HALF (1 << 4) ///< vertical mv halfpel resolution indicator
#define BS_MV_X_HALF (1 << 5) ///< horizontal mv halfpel resolution indicator
}
-/* Fill n lines with 64bit pixel value pix */
+/* Fill n lines with 64-bit pixel value pix */
static inline void fill_64(uint8_t *dst, const uint64_t pix, int32_t n,
int32_t row_offset)
{
/**
- * Pack two delta values (a,b) into one 16bit word
+ * Pack two delta values (a,b) into one 16-bit word
* according with endianness of the host machine.
*/
#if HAVE_BIGENDIAN
#undef PD
/**
- * Pack four delta values (a,a,b,b) into one 32bit word
+ * Pack four delta values (a,a,b,b) into one 32-bit word
* according with endianness of the host machine.
*/
#if HAVE_BIGENDIAN
return -1; /* marker */
}
if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");
- return -1; /* h263 id */
+ av_log(s->avctx, AV_LOG_ERROR, "Bad H.263 id\n");
+ return -1; /* H.263 id */
}
skip_bits1(&s->gb); /* split screen off */
skip_bits1(&s->gb); /* camera off */
format = get_bits(&s->gb, 3);
if (format == 0 || format == 6) {
- av_log(s->avctx, AV_LOG_ERROR, "Intel H263 free format not supported\n");
+ av_log(s->avctx, AV_LOG_ERROR, "Intel H.263 free format not supported\n");
return -1;
}
s->h263_plus = 0;
} else {
format = get_bits(&s->gb, 3);
if(format == 0 || format == 7){
- av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n");
+ av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H.263 format\n");
return -1;
}
if(get_bits(&s->gb, 2))
/*
* Interplay MVE Video Decoder
- * Copyright (C) 2003 the ffmpeg project
+ * Copyright (C) 2003 The FFmpeg project
*
* This file is part of Libav.
*
int t, l;
if (i < 0) {
*level =
- *final = // prevent 'may be used unilitialized'
+ *final = // prevent 'may be used uninitialized'
*run = 64; // this would cause error exit in the ac loop
return;
}
sm = ac_decode_table[i];
e = get_bits(w->gb, sm & 0xF);
- sm >>= 8; // 3bits
+ sm >>= 8; // 3 bits
mask = sm & 0xff;
- sm >>= 8; // 1bit
+ sm >>= 8; // 1 bit
- *run = (sm & 0xff) + (e & mask); // 6bits
- *level = (sm >> 8) + (e & ~mask); // 5bits
+ *run = (sm & 0xff) + (e & mask); // 6 bits
+ *level = (sm >> 8) + (e & ~mask); // 5 bits
*final = i > (58 - 46);
} else if (i < 75) { // [73-74]
static const uint8_t crazy_mix_runlevel[32] = {
/*
- * ITU H263 bitstream decoder
+ * ITU H.263 bitstream decoder
* Copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support.
+ * H.263+ support.
* Copyright (c) 2001 Juan J. Sierralta P
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * h263 decoder.
+ * H.263 decoder.
*/
#include <limits.h>
if (!s->h263_long_vectors) {
val = sign_extend(val, 5 + f_code);
} else {
- /* horrible h263 long vector mode */
+ /* horrible H.263 long vector mode */
if (pred < -31 && val < -63)
val += 64;
if (pred > 32 && val > 63)
return SLICE_OK;
}
-/* most is hardcoded. should extend to handle all h263 streams */
+/* Most is hardcoded; should extend to handle all H.263 streams. */
int ff_h263_decode_picture_header(MpegEncContext *s)
{
int format, width, height, i, ret;
return -1;
}
if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");
- return -1; /* h263 id */
+ av_log(s->avctx, AV_LOG_ERROR, "Bad H.263 id\n");
+ return -1; /* H.263 id */
}
skip_bits1(&s->gb); /* split screen off */
skip_bits1(&s->gb); /* camera off */
s->h263_long_vectors = get_bits1(&s->gb);
if (get_bits1(&s->gb) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "H263 SAC not supported\n");
+ av_log(s->avctx, AV_LOG_ERROR, "H.263 SAC not supported\n");
return -1; /* SAC: off */
}
s->obmc= get_bits1(&s->gb); /* Advanced prediction mode */
height = get_bits(&s->gb, 9) * 4;
ff_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
- /* aspected dimensions */
+ /* expected dimensions */
s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8);
s->avctx->sample_aspect_ratio.den= get_bits(&s->gb, 8);
}else{
/*
- * ITU H263 bitstream encoder
+ * ITU H.263 bitstream encoder
* Copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support.
+ * H.263+ support.
* Copyright (c) 2001 Juan J. Sierralta P
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * h263 bitstream encoder.
+ * H.263 bitstream encoder.
*/
#include <limits.h>
put_sbits(&s->pb, 8, temp_ref); /* TemporalReference */
put_bits(&s->pb, 1, 1); /* marker */
- put_bits(&s->pb, 1, 0); /* h263 id */
+ put_bits(&s->pb, 1, 0); /* H.263 id */
put_bits(&s->pb, 1, 0); /* split screen off */
put_bits(&s->pb, 1, 0); /* camera off */
put_bits(&s->pb, 1, 0); /* freeze picture release off */
put_bits(&s->pb, 1, 0); /* Unrestricted Motion Vector: off */
put_bits(&s->pb, 1, 0); /* SAC: off */
put_bits(&s->pb, 1, s->obmc); /* Advanced Prediction */
- put_bits(&s->pb, 1, 0); /* only I/P frames, no PB frame */
+ put_bits(&s->pb, 1, 0); /* only I/P-frames, no PB-frame */
put_bits(&s->pb, 5, s->qscale);
put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */
} else {
}
/**
- * modify qscale so that encoding is acually possible in h263 (limit difference to -2..2)
+ * modify qscale so that encoding is actually possible in H.263 (limit difference to -2..2)
*/
void ff_clean_h263_qscales(MpegEncContext *s){
int i;
init_mv_penalty_and_fcode(s);
}
- s->me.mv_penalty= mv_penalty; //FIXME exact table for msmpeg4 & h263p
+ s->me.mv_penalty= mv_penalty; // FIXME exact table for MSMPEG4 & H.263+
s->intra_ac_vlc_length =s->inter_ac_vlc_length = uni_h263_inter_rl_len;
s->intra_ac_vlc_last_length=s->inter_ac_vlc_last_length= uni_h263_inter_rl_len + 128*64;
}
s->ac_esc_length= 7+1+6+8;
- // use fcodes >1 only for mpeg4 & h263 & h263p FIXME
+ // use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME
switch(s->codec_id){
case AV_CODEC_ID_MPEG4:
s->fcode_tab= fcode_tab;
s->max_qcoeff= 127;
}
break;
- //Note for mpeg4 & h263 the dc-scale table will be set per frame as needed later
+ // Note for MPEG-4 & H.263 the dc-scale table will be set per frame as needed later
case AV_CODEC_ID_FLV1:
if (s->h263_flv > 1) {
s->min_qcoeff= -1023;
/**
* @file
- * DSP functions (inverse transforms, motion compensation, wavelet recompostions)
+ * DSP functions (inverse transforms, motion compensation, wavelet recompositions)
* for Indeo Video Interactive codecs.
*/
/**
* @file
- * DSP functions (inverse transforms, motion compensations, wavelet recompostion)
+ * DSP functions (inverse transforms, motion compensations, wavelet recomposition)
* for Indeo Video Interactive codecs.
*/
av_log(avctx, AV_LOG_ERROR, "Unknown quantization format\n");
break;
}
- /* FIXME: In openjepg code stespize = stepsize * 0.5. Why?
+ /* FIXME: In OpenJPEG code stespize = stepsize * 0.5. Why?
* If not set output of entropic decoder is not correct. */
if (!av_codec_is_encoder(avctx->codec))
band->f_stepsize *= 0.5;
else
reslevel->nbands = 3;
- /* Number of precincts wich span the tile for resolution level reslevelno
+ /* Number of precincts which span the tile for resolution level reslevelno
* see B.6 in ISO/IEC 15444-1:2002 eq. B-16
* num_precincts_x = |- trx_1 / 2 ^ log2_prec_width) -| - (trx_0 / 2 ^ log2_prec_width)
* num_precincts_y = |- try_1 / 2 ^ log2_prec_width) -| - (try_0 / 2 ^ log2_prec_width)
av_freep(&state);
/* the specification says that after doing 0xff escaping unused bits in
- * the last byte must be set to 0, so just append 7 "optional" zero-bits
+ * the last byte must be set to 0, so just append 7 "optional" zero bits
* to avoid special-casing. */
put_bits(&pb2, 7, 0);
size = put_bits_count(&pb2);
} LagarithContext;
/**
- * Compute the 52bit mantissa of 1/(double)denom.
+ * Compute the 52-bit mantissa of 1/(double)denom.
* This crazy format uses floats in an entropy coder and we have to match x86
* rounding exactly, thus ordinary floats aren't portable enough.
* @param denom denominator
- * @return 52bit mantissa
+ * @return 52-bit mantissa
* @see softfloat_mul
*/
static uint64_t softfloat_reciprocal(uint32_t denom)
/**
* (uint32_t)(x*f), where f has the given mantissa, and exponent 0
* Used in combination with softfloat_reciprocal computes x/(double)denom.
- * @param x 32bit integer factor
+ * @param x 32-bit integer factor
* @param mantissa mantissa of f with exponent 0
- * @return 32bit integer value (x*f)
+ * @return 32-bit integer value (x*f)
* @see softfloat_reciprocal
*/
static uint32_t softfloat_mul(uint32_t x, uint64_t mantissa)
int *left_top)
{
/* This is almost identical to add_hfyu_median_pred in huffyuvdsp.h.
- * However the &0xFF on the gradient predictor yealds incorrect output
+ * However the &0xFF on the gradient predictor yields incorrect output
* for lagarith.
*/
int i;
/*
* AMR Audio decoder stub
- * Copyright (c) 2003 the ffmpeg project
+ * Copyright (c) 2003 The FFmpeg project
*
* This file is part of Libav.
*
/* Match desired bitrate */
static int get_bitrate_mode(int bitrate, void *log_ctx)
{
- /* make the correspondance between bitrate and mode */
+ /* make the correspondence between bitrate and mode */
static const AMR_bitrates rates[] = {
{ 4750, MR475 }, { 5150, MR515 }, { 5900, MR59 }, { 6700, MR67 },
{ 7400, MR74 }, { 7950, MR795 }, { 10200, MR102 }, { 12200, MR122 }
* libopus encoder/decoder common code
* Copyright (c) 2012 Nicolas George
*
- * This file is part of libav.
+ * This file is part of Libav.
*
- * libav is free software; you can redistribute it and/or
+ * Libav 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.
*
- * libav is distributed in the hope that it will be useful,
+ * Libav 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 libav; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
* libopus encoder/decoder common code
* Copyright (c) 2012 Nicolas George
*
- * This file is part of libav.
+ * This file is part of Libav.
*
- * libav is free software; you can redistribute it and/or
+ * Libav 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.
*
- * libav is distributed in the hope that it will be useful,
+ * Libav 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 libav; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
const uint8_t *vorbis_offset = ff_vorbis_channel_layout_offsets[avc->channels - 1];
int ch;
- /* Remap channels from vorbis order to libav order */
+ /* Remap channels from Vorbis order to libav order */
for (ch = 0; ch < avc->channels; ch++)
mapping_arr[ch] = mapping[vorbis_offset[ch]];
mapping = mapping_arr;
* Opus encoder using libopus
* Copyright (c) 2012 Nathan Caldwell
*
- * This file is part of libav.
+ * This file is part of Libav.
*
- * libav is free software; you can redistribute it and/or
+ * Libav 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.
*
- * libav is distributed in the hope that it will be useful,
+ * Libav 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 libav; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
p_frame_output->key_frame = 1;
/* Parse the coded frame number from the bitstream. Bytes 14
- * through 17 represesent the frame number. */
+ * through 17 represent the frame number. */
p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
ff_schro_queue_push_back(&p_schro_params->enc_frame_queue,
if (s->vad)
speex_encoder_ctl(s->enc_state, SPEEX_SET_VAD, &s->vad);
- /* Activiting Discontinuous Transmission */
+ /* Activating Discontinuous Transmission */
if (s->dtx) {
speex_encoder_ctl(s->enc_state, SPEEX_SET_DTX, &s->dtx);
if (!(s->abr || s->vad || s->header.vbr))
Output first header packet consisting of theora
header, comment, and tables.
- Each one is prefixed with a 16bit size, then they
+ Each one is prefixed with a 16-bit size, then they
are concatenated together into libavcodec's extradata.
*/
offset = 0;
/*
* AMR Audio encoder stub
- * Copyright (c) 2003 the ffmpeg project
+ * Copyright (c) 2003 The FFmpeg project
*
* This file is part of Libav.
*
static int get_wb_bitrate_mode(int bitrate, void *log_ctx)
{
- /* make the correspondance between bitrate and mode */
+ /* make the correspondence between bitrate and mode */
static const int rates[] = { 6600, 8850, 12650, 14250, 15850, 18250,
19850, 23050, 23850 };
int i, best = -1, min_diff = 0;
/*
- * Interface to xvidcore for mpeg4 encoding
+ * Interface to xvidcore for MPEG-4 encoding
* Copyright (c) 2004 Adam Thayer <krevnik@comcast.net>
*
* This file is part of Libav.
int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */
int gmc;
int me_quality; /**< Motion estimation quality. 0: fast 6: best. */
- int mpeg_quant; /**< Quantization type. 0: H263, 1: MPEG */
+ int mpeg_quant; /**< Quantization type. 0: H.263, 1: MPEG */
};
/**
* Destroy the two-pass plugin context.
*
* @param ref Context pointer for the plugin
- * @param param Destrooy context
+ * @param param Destroy context
* @return Returns 0, success guaranteed
*/
static int xvid_ff_2pass_destroy(struct xvid_context *ref,
avctx->extradata = NULL;
avctx->extradata_size = 0;
if (xvid_flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
- /* In this case, we are claiming to be MPEG4 */
+ /* In this case, we are claiming to be MPEG-4 */
x->quicktime_format = 1;
avctx->codec_id = AV_CODEC_ID_MPEG4;
} else {
{
int i, j;
- /* sort lsfq in ascending order. float bubble agorithm,
+ /* sort lsfq in ascending order. float bubble algorithm,
O(n) if data already sorted, O(n^2) - otherwise */
for(i=0; i<lp_order-1; i++)
for(j=i; j>=0 && lsfq[j] > lsfq[j+1]; j--)
* @param lp_half_order half the number of the amount of LPCs to be
* reconstructed, need to be smaller or equal to MAX_LP_HALF_ORDER
*
- * @note buffers should have a minimux size of 2*lp_half_order elements.
+ * @note buffers should have a minimum size of 2*lp_half_order elements.
*
* TIA/EIA/IS-733 2.4.3.3.5
*/
len = get_bits(&s->gb, 16) - 2;
while (len >= 65) {
- /* only 8 bit precision handled */
+ /* only 8-bit precision handled */
if (get_bits(&s->gb, 4) != 0) {
- av_log(s->avctx, AV_LOG_ERROR, "dqt: 16bit precision\n");
+ av_log(s->avctx, AV_LOG_ERROR, "dqt: 16-bit precision\n");
return -1;
}
index = get_bits(&s->gb, 4);
s->quant_matrixes[index][j] = get_bits(&s->gb, 8);
}
- // XXX FIXME finetune, and perhaps add dc too
+ // XXX FIXME fine-tune, and perhaps add dc too
s->qscale[index] = FFMAX(s->quant_matrixes[index][s->scantable.permutated[1]],
s->quant_matrixes[index][s->scantable.permutated[8]]) >> 1;
av_log(s->avctx, AV_LOG_DEBUG, "qscale[%d]: %d\n",
av_log(s->avctx, AV_LOG_INFO,
"Pegasus lossless jpeg header found\n");
skip_bits(&s->gb, 16); /* version ? */
- skip_bits(&s->gb, 16); /* unknwon always 0? */
- skip_bits(&s->gb, 16); /* unknwon always 0? */
- skip_bits(&s->gb, 16); /* unknwon always 0? */
+ skip_bits(&s->gb, 16); /* unknown always 0? */
+ skip_bits(&s->gb, 16); /* unknown always 0? */
+ skip_bits(&s->gb, 16); /* unknown always 0? */
switch (get_bits(&s->gb, 8)) {
case 1:
s->rgb = 1;
int maxval;
int near; ///< near lossless bound (si 0 for lossless)
int t1,t2,t3;
- int reset; ///< context halfing intervall ?rename
+ int reset; ///< context halfing interval ?rename
int width, height;
int mb_width, mb_height;
#include "put_bits.h"
typedef struct MJpegContext {
- uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chrom, for easier addressing
+ uint8_t huff_size_dc_luminance[12]; //FIXME use array [3] instead of lumi / chroma, for easier addressing
uint16_t huff_code_dc_luminance[12];
uint8_t huff_size_dc_chrominance[12];
uint16_t huff_code_dc_chrominance[12];
int group1_samplerate; ///< Sample rate of first substream
int group2_samplerate; ///< Sample rate of second substream (MLP only)
- int channel_modifier_thd_stream0; ///< Channel modifier for substream 0 of TrueHD sreams ("2-channel presentation")
- int channel_modifier_thd_stream1; ///< Channel modifier for substream 1 of TrueHD sreams ("6-channel presentation")
- int channel_modifier_thd_stream2; ///< Channel modifier for substream 2 of TrueHD sreams ("8-channel presentation")
+ int channel_modifier_thd_stream0; ///< Channel modifier for substream 0 of TrueHD streams ("2-channel presentation")
+ int channel_modifier_thd_stream1; ///< Channel modifier for substream 1 of TrueHD streams ("6-channel presentation")
+ int channel_modifier_thd_stream2; ///< Channel modifier for substream 2 of TrueHD streams ("8-channel presentation")
int channels_mlp; ///< Channel count for MLP streams
int channels_thd_stream1; ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation")
// being busy from decoder waiting for input. So just poll at the start and
// keep feeding new data to the buffer.
// We are pretty sure the decoder will produce output if we sent more input
- // frames than what a h264 decoder could logically delay. This avoids too
+ // frames than what a H.264 decoder could logically delay. This avoids too
// excessive buffering.
// We also wait if we sent eos, but didn't receive it yet (think of decoding
// stream with a very low number of frames).
cx= (cx>>1)|(cx&1);
cy= (cy>>1)|(cy&1);
uvdxy= (cx&1) + 2*(cy&1);
- //FIXME x/y wrong, but mpeg4 qpel is sick anyway, we should drop as much of it as possible in favor for h264
+ // FIXME x/y wrong, but MPEG-4 qpel is sick anyway, we should drop as much of it as possible in favor for H.264
}
}else{
c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h);
c->xmax = - x + s->mb_width *16;
c->ymax = - y + s->mb_height*16;
} else if (s->out_format == FMT_H261){
- // Search range of H261 is different from other codec standards
+ // Search range of H.261 is different from other codec standards
c->xmin = (x > 15) ? - 15 : 0;
c->ymin = (y > 15) ? - 15 : 0;
c->xmax = (x < s->mb_width * 16 - 16) ? 15 : 0;
if (s->out_format == FMT_H263) {
c->pred_x = P_MEDIAN[0];
c->pred_y = P_MEDIAN[1];
- } else { /* mpeg1 at least */
+ } else { /* MPEG-1 at least */
c->pred_x = P_LEFT[0];
c->pred_y = P_LEFT[1];
}
dmin= direct_search(s, mb_x, mb_y);
else
dmin= INT_MAX;
-//FIXME penalty stuff for non mpeg4
+// FIXME penalty stuff for non-MPEG-4
c->skip=0;
fmin = estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code) +
3 * penalty_factor;
{ /* ensure that the best point is in the MAP as h/qpel refinement needs it */
const unsigned key = (best[1]<<ME_MAP_MV_BITS) + best[0] + map_generation;
const int index= ((best[1]<<ME_MAP_SHIFT) + best[0])&(ME_MAP_SIZE-1);
- if(map[index]!=key){ //this will be executed only very rarey
+ if (map[index] != key) { // this will be executed only very rarely
score_map[index]= cmp(s, best[0], best[1], 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[index]= key;
}
if( best[0] < xmax && best[0] > xmin
&& best[1] < ymax && best[1] > ymin){
int d;
- //ensure that the refernece samples for hpel refinement are in the map
+ // ensure that the reference samples for hpel refinement are in the map
CHECK_MV(best[0]-1, best[1])
CHECK_MV(best[0]+1, best[1])
CHECK_MV(best[0], best[1]-1)
unsigned map_generation;
int penalty_factor;
const int ref_mv_stride= s->mb_stride; //pass as arg FIXME
- const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; //add to last_mv beforepassing FIXME
+ const int ref_mv_xy = s->mb_x + s->mb_y * ref_mv_stride; // add to last_mv before passing FIXME
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
return dmin;
}
-//this function is dedicated to the braindamaged gcc
+//this function is dedicated to the brain damaged gcc
int ff_epzs_motion_search(MpegEncContext *s, int *mx_ptr, int *my_ptr,
int P[10][2], int src_index, int ref_index,
int16_t (*last_mv)[2], int ref_mv_scale,
/*
- * Generate a header file for hardcoded motionpixels RGB to YUV table
+ * Generate a header file for hardcoded motion pixels RGB to YUV table
*
* Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
*
/*
- * Header file for hardcoded motionpixels RGB to YUV table
+ * Header file for hardcoded motion pixels RGB to YUV table
*
* Copyright (c) 2009 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
*
/*
- * MPEG1/2 common code
+ * MPEG-1/2 common code
* Copyright (c) 2007 Aurelien Jacobs <aurel@gnuage.org>
*
* This file is part of Libav.
/*
- * MPEG1/2 tables
+ * MPEG-1/2 tables
* copyright (c) 2000,2001 Fabrice Bellard
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * MPEG1/2 tables.
+ * MPEG-1/2 tables.
*/
#include "mpeg12data.h"
/*
- * MPEG1/2 tables
+ * MPEG-1/2 tables
* copyright (c) 2000,2001 Fabrice Bellard
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * MPEG1/2 tables.
+ * MPEG-1/2 tables.
*/
#ifndef AVCODEC_MPEG12DATA_H
if (get_bits1(&s->gb) == 0) {
if (get_bits1(&s->gb) == 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "invalid mb type in I Frame at %d %d\n",
+ "Invalid mb type in I-frame at %d %d\n",
s->mb_x, s->mb_y);
return AVERROR_INVALIDDATA;
}
mb_type = get_vlc2(&s->gb, ff_mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1);
if (mb_type < 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
+ "Invalid mb type in P-frame at %d %d\n", s->mb_x, s->mb_y);
return AVERROR_INVALIDDATA;
}
mb_type = ptype2mb_type[mb_type];
mb_type = get_vlc2(&s->gb, ff_mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1);
if (mb_type < 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
+ "Invalid mb type in B-frame at %d %d\n", s->mb_x, s->mb_y);
return AVERROR_INVALIDDATA;
}
mb_type = btype2mb_type[mb_type];
int i;
if (s->pict_type == AV_PICTURE_TYPE_I) {
av_log(s->avctx, AV_LOG_ERROR,
- "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
+ "skipped MB in I-frame at %d %d\n", s->mb_x, s->mb_y);
return AVERROR_INVALIDDATA;
}
int cc_count = 0;
int i;
// There is a caption count field in the data, but it is often
- // incorect. So count the number of captions present.
+ // incorrect. So count the number of captions present.
for (i = 5; i + 6 <= buf_size && ((p[i] & 0xfe) == 0xfe); i += 6)
cc_count++;
// Transform the DVD format into A53 Part 4 format
/*
- * MPEG1/2 encoder
+ * MPEG-1/2 encoder
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * MPEG1/2 encoder
+ * MPEG-1/2 encoder
*/
#include <stdint.h>
if (find_frame_rate_index(s) < 0) {
if (s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
- av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n",
+ av_log(avctx, AV_LOG_ERROR, "MPEG-1/2 does not support %d/%d fps\n",
avctx->time_base.den, avctx->time_base.num);
return -1;
} else {
av_log(avctx, AV_LOG_INFO,
- "MPEG1/2 does not support %d/%d fps, there may be AV sync issues\n",
+ "MPEG-1/2 does not support %d/%d fps, there may be AV sync issues\n",
avctx->time_base.den, avctx->time_base.num);
}
}
if (s->current_picture.f->key_frame) {
AVRational framerate = ff_mpeg12_frame_rate_tab[s->frame_rate_index];
- /* mpeg1 header repeated every gop */
+ /* MPEG-1 header repeated every GOP */
put_header(s, SEQ_START_CODE);
put_sbits(&s->pb, 12, s->width);
AVFrameSideData *side_data;
mpeg1_encode_sequence_header(s);
- /* mpeg1 picture header */
+ /* MPEG-1 picture header */
put_header(s, PICTURE_START_CODE);
/* temporal reference */
/*
- * MPEG1/2 VLC
+ * MPEG-1/2 VLC
* copyright (c) 2000,2001 Fabrice Bellard
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* @file
- * MPEG1/2 VLC.
+ * MPEG-1/2 VLC.
*/
#ifndef AVCODEC_MPEG12VLC_H
/*
* copyright (c) 2000,2001 Fabrice Bellard
- * H263+ support
+ * H.263+ support
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of Libav.
/**
* @file
- * mpeg4 tables.
+ * MPEG-4 tables.
*/
#ifndef AVCODEC_MPEG4DATA_H
#include <stdint.h>
#include "mpegvideo.h"
-/* dc encoding for mpeg4 */
+/* dc encoding for MPEG-4 */
const uint8_t ff_mpeg4_DCtab_lum[13][2] =
{
{3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7},
/*
- * MPEG4 decoder / encoder common code.
+ * MPEG-4 decoder / encoder common code
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at>
*
memset(s->ac_val[2] + c_xy, 0, (c_wrap + 1) * 16 * sizeof(int16_t));
/* clean MV */
- // we can't clear the MVs as they might be needed by a b frame
+ // we can't clear the MVs as they might be needed by a B-frame
s->last_mv[0][0][0] =
s->last_mv[0][0][1] =
s->last_mv[1][0][0] =
#define tab_size ((signed)FF_ARRAY_ELEMS(s->direct_scale_mv[0]))
#define tab_bias (tab_size / 2)
-// used by mpeg4 and rv10 decoder
+// used by MPEG-4 and rv10 decoder
void ff_mpeg4_init_direct_mv(MpegEncContext *s)
{
int i;
/*
- * MPEG4 encoder/decoder internal header.
+ * MPEG-4 encoder/decoder internal header.
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at>
*
int cplx_estimation_trash_b;
} Mpeg4DecContext;
-/* dc encoding for mpeg4 */
+/* dc encoding for MPEG-4 */
extern const uint8_t ff_mpeg4_DCtab_lum[13][2];
extern const uint8_t ff_mpeg4_DCtab_chrom[13][2];
/*
- * MPEG4 Video frame extraction
+ * MPEG-4 video frame extraction
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2003 Michael Niedermayer
*
/*
- * MPEG4 video parser prototypes
+ * MPEG-4 video parser prototypes
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2003 Michael Niedermayer
*
/*
- * MPEG4 decoder.
+ * MPEG-4 decoder
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at>
*
while ((1 << alpha) < w)
alpha++;
while ((1 << beta) < h)
- beta++; /* typo in the mpeg4 std for the definition of w' and h' */
+ beta++; /* typo in the MPEG-4 std for the definition of w' and h' */
w2 = 1 << alpha;
h2 = 1 << beta;
/* sprite_ref[3][0] = (a >> 1) * (2 * vop_ref[3][0] + d[0][0] + d[1][0] + d[2][0] + d[3][0]);
* sprite_ref[3][1] = (a >> 1) * (2 * vop_ref[3][1] + d[0][1] + d[1][1] + d[2][1] + d[3][1]); */
- /* this is mostly identical to the mpeg4 std (and is totally unreadable
+ /* This is mostly identical to the MPEG-4 std (and is totally unreadable
* because of that...). Perhaps it should be reordered to be more readable.
* The idea behind this virtual_ref mess is to be able to use shifts later
* per pixel instead of divides so the distance between points is converted
ff_thread_await_progress(&s->next_picture_ptr->tf, s->mb_y, 0);
}
- /* if we skipped it in the future P Frame than skip it now too */
+ /* if we skipped it in the future P-frame than skip it now too */
s->mb_skipped = s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC
if (s->mb_skipped) {
}
} else {
/* is setting low delay flag only once the smartest thing to do?
- * low delay detection won't be overriden. */
+ * low delay detection will not be overridden. */
if (s->picture_number == 0)
s->low_delay = 0;
}
s->interlaced_dct = 0;
if (!get_bits1(gb) && (s->avctx->debug & FF_DEBUG_PICT_INFO))
av_log(s->avctx, AV_LOG_INFO, /* OBMC Disable */
- "MPEG4 OBMC not supported (very likely buggy encoder)\n");
+ "MPEG-4 OBMC not supported (very likely buggy encoder)\n");
if (vo_ver_id == 1)
ctx->vol_sprite_usage = get_bits1(gb); /* vol_sprite_usage */
else
ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* intra_cae */
ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* inter_cae */
ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* no_update */
- ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* upampling */
+ ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* upsampling */
}
if (!get_bits1(gb)) {
ctx->cplx_estimation_trash_i += 8 * get_bits1(gb); /* intra_blocks */
s->divx_packed = e == 3 && last == 'p';
if (s->divx_packed && !ctx->showed_packed_warning) {
av_log(s->avctx, AV_LOG_WARNING,
- "Invalid and inefficient vfw-avi packed B frames detected\n");
+ "Invalid and inefficient vfw-avi packed B-frames detected\n");
ctx->showed_packed_warning = 1;
}
}
if (s->pp_time <= s->pb_time ||
s->pp_time <= s->pp_time - s->pb_time ||
s->pp_time <= 0) {
- /* messed up order, maybe after seeking? skipping current b-frame */
+ /* messed up order, maybe after seeking? skipping current B-frame */
return FRAME_SKIPPED;
}
ff_mpeg4_init_direct_mv(s);
s->chroma_qscale = s->qscale = get_bits(gb, s->quant_precision);
if (s->qscale == 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "Error, header damaged or not MPEG4 header (qscale=0)\n");
+ "Error, header damaged or not MPEG-4 header (qscale=0)\n");
return -1; // makes no sense to continue, as there is nothing left from the image then
}
s->f_code = get_bits(gb, 3); /* fcode_for */
if (s->f_code == 0) {
av_log(s->avctx, AV_LOG_ERROR,
- "Error, header damaged or not MPEG4 header (f_code=0)\n");
+ "Error, header damaged or not MPEG-4 header (f_code=0)\n");
return -1; // makes no sense to continue, as there is nothing left from the image then
}
} else
}
}
/* detect buggy encoders which don't set the low_delay flag
- * (divx4/xvid/opendivx). Note we cannot detect divx5 without b-frames
+ * (divx4/xvid/opendivx). Note we cannot detect divx5 without B-frames
* easily (although it's buggy too) */
if (s->vo_type == 0 && ctx->vol_control_parameters == 0 &&
ctx->divx_version == -1 && s->picture_number == 0) {
}
/**
- * Decode mpeg4 headers.
+ * Decode MPEG-4 headers.
* @return <0 if no VOP found (or a damaged one)
* FRAME_SKIPPED if a not coded VOP is found
* 0 if a VOP is found
Mpeg4DecContext *ctx = avctx->priv_data;
MpegEncContext *s = &ctx->m;
- /* divx 5.01+ bistream reorder stuff */
+ /* divx 5.01+ bitstream reorder stuff */
if (s->divx_packed) {
int current_pos = get_bits_count(&s->gb) >> 3;
int startcode_found = 0;
}
s->h263_pred = 1;
- s->low_delay = 0; /* default, might be overriden in the vol header during header parsing */
+ s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */
s->decode_mb = mpeg4_decode_mb;
ctx->time_increment_bits = 4; /* default value for broken headers */
/*
- * MPEG4 encoder.
+ * MPEG-4 encoder
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at>
*
#include "mpeg4video.h"
/* The uni_DCtab_* tables below contain unified bits+length tables to encode DC
- * differences in mpeg4. Unified in the sense that the specification specifies
+ * differences in MPEG-4. Unified in the sense that the specification specifies
* this encoding in several steps. */
static uint8_t uni_DCtab_lum_len[512];
static uint8_t uni_DCtab_chrom_len[512];
//#define UNI_MPEG4_ENC_INDEX(last, run, level) ((last) * 128 * 64 + (run) + (level) * 64)
#define UNI_MPEG4_ENC_INDEX(last, run, level) ((last) * 128 * 64 + (run) * 128 + (level))
-/* mpeg4
+/* MPEG-4
* inter
* max level: 24/6
* max run: 53/63
}
/**
- * Return the optimal value (0 or 1) for the ac_pred element for the given MB in mpeg4.
+ * Return the optimal value (0 or 1) for the ac_pred element for the given MB in MPEG-4.
* This function will also update s->block_last_index and s->ac_val.
* @param[in,out] block MB coefficients, these will be updated if 1 is returned
* @param[in] dir ac prediction direction for each 8x8 block
}
/**
- * modify mb_type & qscale so that encoding is acually possible in mpeg4
+ * modify mb_type & qscale so that encoding is actually possible in MPEG-4
*/
void ff_clean_mpeg4_qscales(MpegEncContext *s)
{
if (s->pict_type == AV_PICTURE_TYPE_B) {
int odd = 0;
/* ok, come on, this isn't funny anymore, there's more code for
- * handling this mpeg4 mess than for the actual adaptive quantization */
+ * handling this MPEG-4 mess than for the actual adaptive quantization */
for (i = 0; i < s->mb_num; i++) {
int mb_xy = s->mb_index2xy[i];
const int last_index = s->block_last_index[n];
if (s->mb_intra) { // Note gcc (3.2.1 at least) will optimize this away
- /* mpeg4 based DC predictor */
+ /* MPEG-4 based DC predictor */
mpeg4_encode_dc(dc_pb, intra_dc, n);
if (last_index < 1)
return;
int len = 0;
if (s->mb_intra) { // Note gcc (3.2.1 at least) will optimize this away
- /* mpeg4 based DC predictor */
+ /* MPEG-4 based DC predictor */
len += mpeg4_get_dc_length(intra_dc, n);
if (last_index < 1)
return len;
assert((s->dquant & 1) == 0);
assert(mb_type >= 0);
- /* nothing to do if this MB was skipped in the next P Frame */
+ /* nothing to do if this MB was skipped in the next P-frame */
if (s->next_picture.mbskip_table[s->mb_y * s->mb_stride + s->mb_x]) { // FIXME avoid DCT & ...
s->skip_count++;
s->mv[0][0][0] =
if ((cbp | motion_x | motion_y | s->dquant) == 0 &&
s->mv_type == MV_TYPE_16X16) {
- /* check if the B frames can skip it too, as we must skip it
+ /* Check if the B-frames can skip it too, as we must skip it
* if we skip here why didn't they just compress
* the skip-mb bits instead of reusing them ?! */
if (s->max_b_frames > 0) {
}
/**
- * add mpeg4 stuffing bits (01...1)
+ * add MPEG-4 stuffing bits (01...1)
*/
void ff_mpeg4_stuffing(PutBitContext *pbc)
{
put_bits(&s->pb, 2, 0); /* sprite enable */
put_bits(&s->pb, 1, 0); /* not 8 bit == false */
- put_bits(&s->pb, 1, s->mpeg_quant); /* quant type= (0=h263 style)*/
+ put_bits(&s->pb, 1, s->mpeg_quant); /* quant type = (0 = H.263 style) */
if (s->mpeg_quant) {
ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
}
}
-/* write mpeg4 VOP header */
+/* write MPEG-4 VOP header */
void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
{
int time_incr;
uint8_t *sc;
int slen, slen1, slen2;
- /* MPEG1 scale factors */
+ /* MPEG-1 scale factors */
slen1 = slen_table[0][g->scalefac_compress];
slen2 = slen_table[1][g->scalefac_compress];
ff_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
that the frame size must be computed externally */
int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header);
-/* useful helper to get mpeg audio stream infos. Return -1 if error in
+/* useful helper to get MPEG audio stream info. Return -1 if error in
header, otherwise the coded frame size in bytes */
int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate,
int *channels, int *frame_size, int *bitrate);
}
/*
- * Output the mpeg audio layer 2 frame. Note how the code is small
+ * Output the MPEG audio layer 2 frame. Note how the code is small
* compared to other encoders :-)
*/
static void encode_frame(MpegAudioContext *s,
/* header */
put_bits(p, 12, 0xfff);
- put_bits(p, 1, 1 - s->lsf); /* 1 = mpeg1 ID, 0 = mpeg2 lsf ID */
+ put_bits(p, 1, 1 - s->lsf); /* 1 = MPEG-1 ID, 0 = MPEG-2 lsf ID */
put_bits(p, 2, 4-2); /* layer 2 */
put_bits(p, 1, 1); /* no error protection */
put_bits(p, 4, s->bitrate_index);
int alloc_size = FFALIGN(FFABS(linesize) + 32, 32);
// edge emu needs blocksize + filter length - 1
- // (= 17x17 for halfpel / 21x21 for h264)
- // VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9
+ // (= 17x17 for halfpel / 21x21 for H.264)
+ // VC-1 computes luma and chroma simultaneously and needs 19X19 + 9x9
// at uvlinesize. It supports only YUV420 so 24x24 is enough
// linesize * interlaced * MBsize
FF_ALLOCZ_OR_GOTO(avctx, sc->edge_emu_buffer, alloc_size * 2 * 24,
block[0] = block[0] * s->y_dc_scale;
else
block[0] = block[0] * s->c_dc_scale;
- /* XXX: only mpeg1 */
+ /* XXX: only MPEG-1 */
quant_matrix = s->intra_matrix;
for(i=1;i<=nCoeffs;i++) {
int j= s->intra_scantable.permutated[i];
s->next_p_frame_damaged = s1->next_p_frame_damaged;
s->workaround_bugs = s1->workaround_bugs;
- // MPEG4 timing info
+ // MPEG-4 timing info
memcpy(&s->last_time_base, &s1->last_time_base,
(char *) &s1->pb_field_time + sizeof(s1->pb_field_time) -
(char *) &s1->last_time_base);
AV_INPUT_BUFFER_PADDING_SIZE);
}
- // linesize dependend scratch buffer allocation
+ // linesize-dependent scratch buffer allocation
if (!s->sc.edge_emu_buffer)
if (s1->linesize) {
if (ff_mpeg_framesize_alloc(s->avctx, &s->me,
return AVERROR_BUG;
}
- // MPEG2/interlacing info
+ // MPEG-2/interlacing info
memcpy(&s->progressive_sequence, &s1->progressive_sequence,
(char *) &s1->rtp_mode - (char *) &s1->progressive_sequence);
mb_array_size = s->mb_height * s->mb_stride;
mv_table_size = (s->mb_height + 2) * s->mb_stride + 1;
- /* set default edge pos, will be overriden
+ /* set default edge pos, will be overridden
* in decode_header if needed */
s->h_edge_pos = s->mb_width * 16;
s->v_edge_pos = s->mb_height * 16;
yc_size = y_size + 2 * c_size;
FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int),
- fail); // error ressilience code looks cleaner with this
+ fail); // error resilience code looks cleaner with this
for (y = 0; y < s->mb_height; y++)
for (x = 0; x < s->mb_width; x++)
s->mb_index2xy[x + y * s->mb_width] = x + y * s->mb_stride;
/* init macroblock skip table */
FF_ALLOCZ_OR_GOTO(s->avctx, s->mbskip_table, mb_array_size + 2, fail);
- // Note the + 1 is for a quicker mpeg4 slice_end detection
+ // Note the + 1 is for a quicker MPEG-4 slice_end detection
return ff_mpeg_er_init(s);
fail:
}
/* release forgotten pictures */
- /* if (mpeg124/h263) */
+ /* if (MPEG-124 / H.263) */
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
if (&s->picture[i] != s->last_picture_ptr &&
&s->picture[i] != s->next_picture_ptr &&
}
/* set dequantizer, we can't do it during init as
- * it might change for mpeg4 and we can't do it in the header
- * decode as init is not called for mpeg4 there yet */
+ * it might change for MPEG-4 and we can't do it in the header
+ * decode as init is not called for MPEG-4 there yet */
if (s->mpeg_quant || s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
int y_dc_scale, c_dc_scale;
int ac_pred;
int block_last_index[12]; ///< last non zero coefficient in block
- int h263_aic; ///< Advanded INTRA Coding (AIC)
+ int h263_aic; ///< Advanced INTRA Coding (AIC)
/* scantables */
- ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce tha cache usage
+ ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce the cache usage
ScanTable intra_scantable;
ScanTable intra_h_scantable;
ScanTable intra_v_scantable;
/* WARNING: changes above this line require updates to hardcoded
- * offsets used in asm. */
+ * offsets used in ASM. */
struct AVCodecContext *avctx;
/* the following parameters must be initialized before encoding */
int intra_only; ///< if true, only intra pictures are generated
int bit_rate; ///< wanted bit rate
enum OutputFormat out_format; ///< output format
- int h263_pred; ///< use mpeg4/h263 ac/dc predictions
- int pb_frame; ///< PB frame mode (0 = none, 1 = base, 2 = improved)
+ int h263_pred; ///< use MPEG-4/H.263 ac/dc predictions
+ int pb_frame; ///< PB-frame mode (0 = none, 1 = base, 2 = improved)
/* the following codec id fields are deprecated in favor of codec_id */
- int h263_plus; ///< h263 plus headers
- int h263_flv; ///< use flv h263 header
+ int h263_plus; ///< H.263+ headers
+ int h263_flv; ///< use flv H.263 header
enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
int fixed_qscale; ///< fixed qscale if non zero
int encoding; ///< true if we are encoding (vs decoding)
- int max_b_frames; ///< max number of b-frames for encoding
+ int max_b_frames; ///< max number of B-frames for encoding
int luma_elim_threshold;
int chroma_elim_threshold;
- int strict_std_compliance; ///< strictly follow the std (MPEG4, ...)
+ int strict_std_compliance; ///< strictly follow the std (MPEG-4, ...)
int workaround_bugs; ///< workaround bugs in encoders which cannot be detected automatically
int codec_tag; ///< internal codec_tag upper case converted from avctx codec_tag
/* the following fields are managed internally by the encoder */
ptrdiff_t uvlinesize; ///< line size, for chroma in bytes, may be different from width
Picture *picture; ///< main picture buffer
Picture **input_picture; ///< next pictures on display order for encoding
- Picture **reordered_input_picture; ///< pointer to the next pictures in codedorder for encoding
+ Picture **reordered_input_picture; ///< pointer to the next pictures in coded order for encoding
int64_t user_specified_pts; ///< last non-zero pts from AVFrame which was passed into avcodec_encode_video2()
/**
Picture *last_picture_ptr; ///< pointer to the previous picture.
Picture *next_picture_ptr; ///< pointer to the next picture (for bidir pred)
Picture *current_picture_ptr; ///< pointer to the current picture
- int last_dc[3]; ///< last DC values for MPEG1
+ int last_dc[3]; ///< last DC values for MPEG-1
int16_t *dc_val_base;
- int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous
+ int16_t *dc_val[3]; ///< used for MPEG-4 DC prediction, all 3 arrays must be continuous
const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table
const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table
- const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (h263)
+ const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (H.263)
uint8_t *coded_block_base;
uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1)
int16_t (*ac_val_base)[16];
- int16_t (*ac_val[3])[16]; ///< used for for mpeg4 AC prediction, all 3 arrays must be continuous
+ int16_t (*ac_val[3])[16]; ///< used for for MPEG-4 AC prediction, all 3 arrays must be continuous
int mb_skipped; ///< MUST BE SET only during DECODING
uint8_t *mbskip_table; /**< used to avoid copy if macroblock skipped (for black regions for example)
- and used for b-frame encoding & decoding (contains skip table of next P Frame) */
+ and used for B-frame encoding & decoding (contains skip table of next P-frame) */
uint8_t *mbintra_table; ///< used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
uint8_t *cbp_table; ///< used to store cbp, ac_pred for partitioned decoding
uint8_t *pred_dir_table; ///< used to store pred_dir for partitioned decoding
int qscale; ///< QP
int chroma_qscale; ///< chroma QP
- unsigned int lambda; ///< lagrange multipler used in rate distortion
+ unsigned int lambda; ///< Lagrange multiplier used in rate distortion
unsigned int lambda2; ///< (lambda*lambda) >> FF_LAMBDA_SHIFT
int *lambda_table;
int adaptive_quant; ///< use adaptive quantization
int dquant; ///< qscale difference to prev qscale
int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int last_pict_type; //FIXME removes
- int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol
+ int last_non_b_pict_type; ///< used for MPEG-4 gmc B-frames & ratecontrol
int droppable;
int frame_rate_index;
int last_lambda_for[5]; ///< last lambda for a specific pict type
/* motion compensation */
int unrestricted_mv; ///< mv can point outside of the coded picture
- int h263_long_vectors; ///< use horrible h263v1 long vector mode
+ int h263_long_vectors; ///< use horrible H.263v1 long vector mode
BlockDSPContext bdsp;
FDCTDSPContext fdsp;
VideoDSPContext vdsp;
H263DSPContext h263dsp;
int f_code; ///< forward MV resolution
- int b_code; ///< backward MV resolution for B Frames (mpeg4)
+ int b_code; ///< backward MV resolution for B-frames (MPEG-4)
int16_t (*p_mv_table_base)[2];
int16_t (*b_forw_mv_table_base)[2];
int16_t (*b_back_mv_table_base)[2];
int16_t (*b_direct_mv_table_base)[2];
int16_t (*p_field_mv_table_base[2][2])[2];
int16_t (*b_field_mv_table_base[2][2][2])[2];
- int16_t (*p_mv_table)[2]; ///< MV table (1MV per MB) p-frame encoding
- int16_t (*b_forw_mv_table)[2]; ///< MV table (1MV per MB) forward mode b-frame encoding
- int16_t (*b_back_mv_table)[2]; ///< MV table (1MV per MB) backward mode b-frame encoding
- int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
- int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode b-frame encoding
- int16_t (*b_direct_mv_table)[2]; ///< MV table (1MV per MB) direct mode b-frame encoding
- int16_t (*p_field_mv_table[2][2])[2]; ///< MV table (2MV per MB) interlaced p-frame encoding
- int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced b-frame encoding
+ int16_t (*p_mv_table)[2]; ///< MV table (1MV per MB) P-frame encoding
+ int16_t (*b_forw_mv_table)[2]; ///< MV table (1MV per MB) forward mode B-frame encoding
+ int16_t (*b_back_mv_table)[2]; ///< MV table (1MV per MB) backward mode B-frame encoding
+ int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode B-frame encoding
+ int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode B-frame encoding
+ int16_t (*b_direct_mv_table)[2]; ///< MV table (1MV per MB) direct mode B-frame encoding
+ int16_t (*p_field_mv_table[2][2])[2]; ///< MV table (2MV per MB) interlaced P-frame encoding
+ int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced B-frame encoding
uint8_t (*p_field_select_table[2]);
uint8_t (*b_field_select_table[2][2]);
#if FF_API_MOTION_EST
int mv_dir;
#define MV_DIR_FORWARD 1
#define MV_DIR_BACKWARD 2
-#define MV_DIRECT 4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
+#define MV_DIRECT 4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (MPEG-4)
int mv_type;
#define MV_TYPE_16X16 0 ///< 1 vector for the whole mb
-#define MV_TYPE_8X8 1 ///< 4 vectors (h263, mpeg4 4MV)
+#define MV_TYPE_8X8 1 ///< 4 vectors (H.263, MPEG-4 4MV)
#define MV_TYPE_16X8 2 ///< 2 vectors, one per 16x8 block
#define MV_TYPE_FIELD 3 ///< 2 vectors, one per field
#define MV_TYPE_DMV 4 ///< 2 vectors, special mpeg2 Dual Prime Vectors
*/
int mv[2][4][2];
int field_select[2][2];
- int last_mv[2][2][2]; ///< last MV, used for MV prediction in MPEG1 & B-frame MPEG4
+ int last_mv[2][2][2]; ///< last MV, used for MV prediction in MPEG-1 & B-frame MPEG-4
uint8_t *fcode_tab; ///< smallest fcode needed for each MV
int16_t direct_scale_mv[2][64]; ///< precomputed to avoid divisions in ff_mpeg4_set_direct_mv
MotionEstContext me;
- int no_rounding; /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
- for b-frames rounding mode is always 0 */
+ int no_rounding; /**< apply no rounding to motion compensation (MPEG-4, msmpeg4, ...)
+ for B-frames rounding mode is always 0 */
/* macroblock layer */
int mb_x, mb_y;
int resync_mb_y; ///< y position of last resync marker
GetBitContext last_resync_gb; ///< used to search for the next resync marker
int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
- int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed b frames
+ int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed B-frames
ParseContext parse_context;
int rc_strategy;
/* H.263+ specific */
- int umvplus; ///< == H263+ && unrestricted_mv
+ int umvplus; ///< == H.263+ && unrestricted_mv
int h263_aic_dir; ///< AIC direction: 0 = left, 1 = top
int h263_slice_structured;
int alt_inter_vlc; ///< alternative inter vlc
int loop_filter;
int custom_pcf;
- /* mpeg4 specific */
+ /* MPEG-4 specific */
///< number of bits to represent the fractional part of time (encoder only)
int time_increment_bits;
int last_time_base;
int sprite_warping_accuracy;
int data_partitioning; ///< data partitioning flag from header
int partitioned_frame; ///< is current frame partitioned
- int low_delay; ///< no reordering needed / has no b-frames
+ int low_delay; ///< no reordering needed / has no B-frames
int vo_type;
PutBitContext tex_pb; ///< used for data partitioned VOPs
PutBitContext pb2; ///< used for data partitioned VOPs
int mpeg_quant;
- int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG4
+ int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG-4
/* divx specific, used to workaround (many) bugs in divx5 */
int divx_packed;
int dc_table_index;
int use_skip_mb_code;
int slice_height; ///< in macroblocks
- int first_slice_line; ///< used in mpeg4 too to handle resync markers
+ int first_slice_line; ///< used in MPEG-4 too to handle resync markers
int flipflop_rounding;
int msmpeg4_version; ///< 0=not msmpeg4, 1=mp41, 2=mp42, 3=mp43/divx3 4=wmv1/7 5=wmv2/8
int per_mb_rl_table;
/* decompression specific */
GetBitContext gb;
- /* Mpeg1 specific */
- int gop_picture_number; ///< index of the first picture of a GOP based on fake_pic_num & mpeg1 specific
- int last_mv_dir; ///< last mv_dir, used for b frame encoding
+ /* MPEG-1 specific */
+ int gop_picture_number; ///< index of the first picture of a GOP based on fake_pic_num & MPEG-1 specific
+ int last_mv_dir; ///< last mv_dir, used for B-frame encoding
uint8_t *vbv_delay_ptr; ///< pointer to vbv_delay in the bitstream
/* MPEG-2-specific - I wished not to have to support this mess. */
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_h263_inter)(struct MpegEncContext *s,
int16_t *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
+ void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (MPEG-4 can use both)
int16_t *block/*align 16*/, int n, int qscale);
- void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
+ void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (MPEG-4 can use both)
int16_t *block/*align 16*/, int n, int qscale);
int (*dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow);
int (*fast_dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow);
/**
* ratecontrol qmin qmax limiting method
- * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
+ * 0-> clipping, 1-> use a nice continuous function to limit qscale within qmin/qmax.
*/
float rc_qsquish;
float rc_qmod_amp;
s->codec_id != AV_CODEC_ID_MPEG4 &&
s->codec_id != AV_CODEC_ID_MPEG1VIDEO &&
s->codec_id != AV_CODEC_ID_MPEG2VIDEO) {
- av_log(avctx, AV_LOG_ERROR, "b frames not supported by codec\n");
+ av_log(avctx, AV_LOG_ERROR, "B-frames not supported by codec\n");
return -1;
}
}
if (s->max_b_frames != 0) {
av_log(avctx, AV_LOG_ERROR,
- "b frames cannot be used with low delay\n");
+ "B-frames cannot be used with low delay\n");
return -1;
}
}
s->intra_matrix[j] =
s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i];
} else {
- /* mpeg1/2 */
+ /* MPEG-1/2 */
s->intra_matrix[j] = ff_mpeg1_default_intra_matrix[i];
s->inter_matrix[j] = ff_mpeg1_default_non_intra_matrix[i];
}
return ret;
pic->f->display_picture_number = display_picture_number;
- pic->f->pts = pts; // we set this here to avoid modifiying pic_arg
+ pic->f->pts = pts; // we set this here to avoid modifying pic_arg
} else {
/* Flushing: When we have not received enough input frames,
* ensure s->input_picture[0] contains the first picture */
if (s->frame_skip_threshold || s->frame_skip_factor) {
if (s->picture_in_gop_number < s->gop_size &&
skip_check(s, s->input_picture[0], s->next_picture_ptr)) {
- // FIXME check that te gop check above is +-1 correct
+ // FIXME check that the gop check above is +-1 correct
av_frame_unref(s->input_picture[0]->f);
emms_c();
if (s->input_picture[b_frames]->f->pict_type == AV_PICTURE_TYPE_B &&
b_frames == s->max_b_frames) {
av_log(s->avctx, AV_LOG_ERROR,
- "warning, too many b frames in a row\n");
+ "warning, too many B-frames in a row\n");
}
if (s->picture_in_gop_number + b_frames >= s->gop_size) {
return ret;
if (s->reordered_input_picture[0]->shared || s->avctx->rc_buffer_size) {
- // input is a shared pix, so we can't modifiy it -> alloc a new
+ // input is a shared pix, so we can't modify it -> allocate a new
// one & ensure that the shared one is reuseable
Picture *pic;
s->frame_bits = put_bits_count(&s->pb);
}
- /* update mpeg1/2 vbv_delay for CBR */
+ /* update MPEG-1/2 vbv_delay for CBR */
if (s->avctx->rc_max_rate &&
s->avctx->rc_min_rate == s->avctx->rc_max_rate &&
s->out_format == FMT_MPEG1 &&
memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster than a loop?
- /* mpeg1 */
+ /* MPEG-1 */
d->mb_skip_run= s->mb_skip_run;
for(i=0; i<3; i++)
d->last_dc[i] = s->last_dc[i];
memcpy(d->mv, s->mv, 2*4*2*sizeof(int));
memcpy(d->last_mv, s->last_mv, 2*2*2*sizeof(int)); //FIXME is memcpy faster than a loop?
- /* mpeg1 */
+ /* MPEG-1 */
d->mb_skip_run= s->mb_skip_run;
for(i=0; i<3; i++)
d->last_dc[i] = s->last_dc[i];
ff_mpv_decode_mb(s, s->block);
}
- /* clean the MV table in IPS frames for direct mode in B frames */
+ /* clean the MV table in IPS frames for direct mode in B-frames */
if(s->mb_intra /* && I,P,S_TYPE */){
s->p_mv_table[xy][0]=0;
s->p_mv_table[xy][1]=0;
s->me.mb_var_sum_temp =
s->me.mc_mb_var_sum_temp = 0;
- /* we need to initialize some time vars before we can encode b-frames */
+ /* we need to initialize some time vars before we can encode B-frames */
// RAL: Condition added for MPEG1VIDEO
if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || s->codec_id == AV_CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->msmpeg4_version))
set_frame_distances(s);
if(s->out_format == FMT_H263){
unquant_coeff= alevel*qmul + qadd;
- }else{ //MPEG1
+ } else { // MPEG-1
j = s->idsp.idct_permutation[scantable[i]]; // FIXME: optimize
if(s->mb_intra){
unquant_coeff = (int)( alevel * qscale * s->intra_matrix[j]) >> 3;
score_tab[i+1]= best_score;
- //Note: there is a vlc code in mpeg4 which is 1 bit shorter then another one with a shorter run and the same level
+ // Note: there is a vlc code in MPEG-4 which is 1 bit shorter then another one with a shorter run and the same level
if(last_non_zero <= 27){
for(; survivor_count; survivor_count--){
if(score_tab[ survivor[survivor_count-1] ] <= best_score)
last_score= 256*256*256*120;
for(i= survivor[0]; i<=last_non_zero + 1; i++){
int score= score_tab[i];
- if(i) score += lambda*2; //FIXME exacter?
+ if (i)
+ score += lambda * 2; // FIXME more exact?
if(score < last_score){
last_score= score;
if(s->out_format == FMT_H263){
unquant_coeff= (alevel*qmul + qadd)>>3;
- }else{ //MPEG1
+ } else { // MPEG-1
unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[0])) >> 4;
unquant_coeff = (unquant_coeff - 1) | 1;
}
#endif
dc += (1<<(RECON_SHIFT-1));
for(i=0; i<64; i++){
- rem[i]= dc - (orig[i]<<RECON_SHIFT); //FIXME use orig dirrectly instead of copying to rem[]
+ rem[i] = dc - (orig[i] << RECON_SHIFT); // FIXME use orig directly instead of copying to rem[]
}
#ifdef REFINE_STATS
STOP_TIMER("memset rem[]")}
}
/**
- * Permute an 8x8 block according to permuatation.
+ * Permute an 8x8 block according to permutation.
* @param block the block which will be permuted according to
* the given permutation vector
* @param permutation the permutation vector
}
/**
- * h263 chroma 4mv motion compensation.
+ * H.263 chroma 4mv motion compensation.
*/
static void chroma_4mv_motion(MpegEncContext *s,
uint8_t *dest_cb, uint8_t *dest_cr,
/*
- * MPEG1 / MPEG2 video parser
+ * MPEG-1 / MPEG-2 video parser
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
/**
* Initialize MQ-decoder.
* @param mqc MQ decoder state
- * @param bp byte poiter
+ * @param bp byte pointer
*/
void ff_mqc_initdec(MqcState *mqc, uint8_t *bp);
* MQ decoder.
* @param mqc MQ decoder state
* @param cxstate Context
- * @return Decision (0 ot 1)
+ * @return Decision (0 to 1)
*/
int ff_mqc_decode(MqcState *mqc, uint8_t *cxstate);
#include "vc1data.h"
/*
- * You can also call this codec : MPEG4 with a twist !
+ * You can also call this codec: MPEG-4 with a twist!
*
* TODO:
* - (encoding) select best mv table (two choices)
* - (encoding) select best vlc/dc table
*/
-/* This table is practically identical to the one from h263
+/* This table is practically identical to the one from H.263
* except that it is inverted. */
static av_cold void init_h263_dc_for_msmpeg4(void)
{
else
l= level;
- /* luminance h263 */
+ /* luminance H.263 */
uni_code= ff_mpeg4_DCtab_lum[size][0];
uni_len = ff_mpeg4_DCtab_lum[size][1];
uni_code ^= (1<<uni_len)-1; //M$ does not like compatibility
ff_v2_dc_lum_table[level + 256][0] = uni_code;
ff_v2_dc_lum_table[level + 256][1] = uni_len;
- /* chrominance h263 */
+ /* chrominance H.263 */
uni_code= ff_mpeg4_DCtab_chrom[size][0];
uni_len = ff_mpeg4_DCtab_chrom[size][1];
uni_code ^= (1<<uni_len)-1; //M$ does not like compatibility
c = FASTDIV((c + (scale >> 1)), scale);
}
#endif
- /* XXX: WARNING: they did not choose the same test as MPEG4. This
+ /* XXX: WARNING: they did not choose the same test as MPEG-4. This
is very important ! */
if(s->msmpeg4_version>3){
if(s->inter_intra_pred){
static VLC v2_mv_vlc;
VLC ff_inter_intra_vlc;
-/* This is identical to h263 except that its range is multiplied by 2. */
+/* This is identical to H.263 except that its range is multiplied by 2. */
static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
{
int code, val, sign, shift;
}
else
{
- av_log(s->avctx, AV_LOG_ERROR, "I frame too long, ignoring ext header\n");
+ av_log(s->avctx, AV_LOG_ERROR, "I-frame too long, ignoring ext header\n");
}
return 0;
}
s->dc_table_index = 1;
- s->mv_table_index = 1; /* only if P frame */
- s->use_skip_mb_code = 1; /* only if P frame */
+ s->mv_table_index = 1; /* only if P-frame */
+ s->use_skip_mb_code = 1; /* only if P-frame */
s->per_mb_rl_table = 0;
if(s->msmpeg4_version==4)
s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
}
}
-/* Encoding of a block. Very similar to MPEG4 except for a different
- escape coding (same as H263) and more vlc tables.
- */
+/* Encoding of a block; very similar to MPEG-4 except for a different
+ * escape coding (same as H.263) and more VLC tables. */
void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n)
{
int level, run, last, i, j, last_index;
/*
* Microsoft RLE video decoder
- * Copyright (C) 2003 the ffmpeg project
+ * Copyright (C) 2003 The FFmpeg project
*
* This file is part of Libav.
*
/*
* Microsoft Video-1 Decoder
- * Copyright (C) 2003 the ffmpeg project
+ * Copyright (C) 2003 The FFmpeg project
*
* This file is part of Libav.
*
// codec data (rtjpeg quant tables)
if (buf[0] == 'D' && buf[1] == 'R') {
int ret;
- // skip rest of the frameheader.
+ // Skip the rest of the frame header.
buf = &buf[12];
buf_size -= 12;
ret = get_quant(avctx, c, buf, buf_size);
keyframe = 1;
break;
}
- // skip rest of the frameheader.
+ // Skip the rest of the frame header.
buf = &buf[12];
buf_size -= 12;
if (comptype == NUV_RTJPEG_IN_LZO || comptype == NUV_LZO) {
ret = nvenc_check_cap(avctx, NV_ENC_CAPS_NUM_MAX_BFRAMES);
if (ret < avctx->max_b_frames) {
- av_log(avctx, AV_LOG_VERBOSE, "Max b-frames %d exceed %d\n",
+ av_log(avctx, AV_LOG_VERBOSE, "Max B-frames %d exceed %d\n",
avctx->max_b_frames, ret);
return AVERROR(ENOSYS);
if (avctx->max_b_frames > 0) {
/* 0 is intra-only,
* 1 is I/P only,
- * 2 is one B Frame,
- * 3 two B frames, and so on. */
+ * 2 is one B-Frame,
+ * 3 two B-frames, and so on. */
ctx->config.frameIntervalP = avctx->max_b_frames + 1;
} else if (avctx->max_b_frames == 0) {
ctx->config.frameIntervalP = 1;
out_buffer.version = NV_ENC_CREATE_BITSTREAM_BUFFER_VER;
/* 1MB is large enough to hold most output frames.
- * NVENC increases this automaticaly if it's not enough. */
+ * NVENC increases this automatically if it is not enough. */
out_buffer.size = BITSTREAM_BUFFER_SIZE;
out_buffer.memoryHeap = NV_ENC_MEMORY_HEAP_SYSMEM_UNCACHED;
enum AVPixelFormat data_pix_fmt;
/* timestamps of the first two frames, for computing the first dts
- * when b-frames are present */
+ * when B-frames are present */
int64_t initial_pts[2];
int first_packet_output;
AVCodec ff_h264_nvenc_encoder = {
.name = "h264_nvenc",
- .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H264 encoder"),
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.init = ff_nvenc_encode_init,
AVCodec ff_nvenc_h264_encoder = {
.name = "nvenc_h264",
- .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H264 encoder"),
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.init = nvenc_old_init,
goto fail;
}
if (avctx->codec->id == AV_CODEC_ID_H264) {
- // For H264, the extradata can be returned in two separate buffers
+ // For H.264, the extradata can be returned in two separate buffers