On Mon, Jul 09, 2012 at 06:42:36AM +0200, Kostya Shishkov wrote:
> ---
> Changelog | 1 +
> doc/general.texi | 2 +
> libavcodec/Makefile | 1 +
> libavcodec/allcodecs.c | 1 +
> libavcodec/avcodec.h | 1 +
> libavcodec/tscc2.c | 382 +++++++++++++++++++
> libavcodec/tscc2data.h | 957
> ++++++++++++++++++++++++++++++++++++++++++++++++
> libavformat/riff.c | 1 +
> 8 files changed, 1346 insertions(+), 0 deletions(-)
> create mode 100644 libavcodec/tscc2.c
> create mode 100644 libavcodec/tscc2data.h
Saving the version bump for push?
> --- /dev/null
> +++ b/libavcodec/tscc2.c
> @@ -0,0 +1,382 @@
> +
> +#define DEQUANT(val, q) ((q * val + 0x80) >> 8)
> +#define DCT1D(d0, d1, d2, d3, s0, s1, s2, s3, OP) \
> + OP(d0, 5 * ((s0) + (s1) + (s2)) + 2 * (s3)); \
> + OP(d1, 5 * ((s0) - (s2) - (s3)) + 2 * (s1)); \
> + OP(d2, 5 * ((s0) - (s2) + (s3)) - 2 * (s3)); \
> + OP(d3, 5 * ((s0) - (s1) + (s2)) - 2 * (s3)); \
Align the \, ideally on column 72.
> +static int decode_mb(TSCC2Context *c, int *q, int vlc_set,
> + uint8_t *dst, int stride, int plane)
This name is too generic, please prefix it.
> + dc = (dc + prev_dc) & 0xFF;
nit: pointless ()
> +static int tscc2_decode_frame(AVCodecContext *avctx, void *data,
> + int *data_size, AVPacket *avpkt)
> +{
> + const uint8_t *buf = avpkt->data;
> + int buf_size = avpkt->size;
> + TSCC2Context *c = avctx->priv_data;
> + GetByteContext gb;
> + uint32_t frame_type, size;
> + int i, pos, val, len;
> +[...]
> + pos = 0;
You could initialize the variable at declaration.
> --- /dev/null
> +++ b/libavcodec/tscc2data.h
> @@ -0,0 +1,957 @@
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with Libav; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
> USA
> + */
> +#ifndef AVCODEC_TSCC2_DATA_H
> +#define AVCODEC_TSCC2_DATA_H
empty line after the comment block please
> +static const uint16_t tscc2_nc_vlc_codes[NUM_VLC_SETS][16] = {
> + {
> + 0x0023, 0x0003, 0x0031, 0x0021, 0x0011, 0x0053, 0x0013, 0x0001,
> + 0x0009, 0x0029, 0x0033, 0x0019, 0x000B, 0x0005, 0x0007, 0x0000,
> + },
Merge the braces and the data lines, like we do everywhere else.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel