On Fri, Aug 17, 2012 at 01:25:24AM +0300, Jan Ekström wrote:
> Rename utvideo.c to utvideodec.c, add a common header
> utvideo.h.
>
> Slices work, but hardcoded to one for the time being.
> All related colorspaces work.
>
> Interlaced encoding is not yet supported.
What's with the line length? A 55 character limit is a little on the
low side.
> ---
> libavcodec/Makefile | 3 +-
> libavcodec/allcodecs.c | 2 +-
> libavcodec/utvideo.h | 96 +++++
> libavcodec/{utvideo.c => utvideodec.c} | 39 +--
> libavcodec/utvideoenc.c | 736
> ++++++++++++++++++++++++++++++++
> 5 files changed, 837 insertions(+), 39 deletions(-)
> create mode 100644 libavcodec/utvideo.h
> rename libavcodec/{utvideo.c => utvideodec.c} (96%)
> create mode 100644 libavcodec/utvideoenc.c
See the new codecs checklist in the developer docs, you missed
a few steps.
Split the renaming off into a separate commit to unclutter this one.
> --- /dev/null
> +++ b/libavcodec/utvideoenc.c
> @@ -0,0 +1,736 @@
> +
> +/* Compares huffentries' symbols */
huffentry
Avoid third person singular form in comments, just use impersonal form:
Compare ..
There are many more such comments below.
> + /*
> + * Second line uses top prediction for the first sample,
> + * and median for the rest.
> + */
nit: This one and many other comments could be squashed into less lines
and made more compact.
> +/* Counts the occurences of values in a plane */
> +static void count_usage(uint8_t *src, int width,
> + int height, uint32_t *counts)
The function name and the comment seemingly disagree.
> +/* Adds two weights together */
> +static uint32_t add_weights(uint32_t w1, uint32_t w2)
/* redundant comment */
> +/* Calculates the huffman code lengths from the counts of values */
from value counts
> + /* Write the codes */
> + for (j = 0; j < height; j++) {
> + for (i = 0; i < width; i++) {
> + put_bits(&pb, he[src[i]].len, he[src[i]].code);
> + }
pointless {}
> + for (i = 0; i < c->slices; i++) {
> + sstart = send;
> + send = (height * (i + 1) / c->slices);
pointless ()
> + /*
> + * Write the huffman codes to a buffer,
> + * get the offset in bits and convert to bytes.
> + */
> + offset += write_huff_codes(dst + (sstart * width), c->slice_bits,
ditto
> + /* Seek to the data part of the packet */
> + bytestream2_seek_p(pb, 4 * (c->slices - (i + 1)) +
> + (offset - slice_len), SEEK_CUR);
ditto
> + /* Seek back to the slice offsets */
> + bytestream2_seek_p(pb, -4 * (c->slices - (i + 1)) - offset,
> + SEEK_CUR);
more
> + /* Allocate a new packet if needed, and set it to the pointer dst */
> + if (!pkt->data)
> + ret = av_new_packet(pkt, (256 + (4 * c->slices) +
> + (width * height)) * c->planes + 4);
You sure love your parentheses :)
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel