On Wed, Oct 02, 2013 at 04:46:26PM +0100, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <[email protected]>
> ---
>  configure              |    5 +
>  libavcodec/Makefile    |    1 +
>  libavcodec/allcodecs.c |    1 +
>  libavcodec/libx265.c   |  195 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 202 insertions(+), 0 deletions(-)
>  create mode 100644 libavcodec/libx265.c

I know it's a WIP, just in case: changelog, version bump, docs

> --- a/configure
> +++ b/configure
> @@ -3808,6 +3812,7 @@ enabled libwavpack        && require libwavpack 
> wavpack/wavpack.h WavpackOpenFil
>  enabled libx264           && require libx264 x264.h x264_encoder_encode 
> -lx264 &&
>                               { check_cpp_condition x264.h "X264_BUILD >= 
> 118" ||
>                                 die "ERROR: libx264 version must be >= 
> 0.118."; }
> +enabled libx265           && require libx265 x265.h x265_encoder_encode 
> -lx265 -lstdc++

gah, C++

more and more this feels like non-community bullshit, sorry

> --- /dev/null
> +++ b/libavcodec/libx265.c
> @@ -0,0 +1,195 @@
> +
> +#include "libavutil/common.h"
> +#include "libavutil/internal.h"
> +#include "avcodec.h"
> +#include "internal.h"
> +
> +#include <x265.h>

system headers before local headers

> +static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> +                                const AVFrame *pic, int *got_packet)
> +{
> +    libx265Context *ctx = avctx->priv_data;
> +    x265_picture_t x265pic;
> +    x265_picture_t x265pic_out;
> +    x265_nal_t *nal;

So they copy-pasted all the POSIX-incompatible _t type names from x264?

> +    memset(&x265pic_out, 0, sizeof(x265pic_out));

Replace with "{ 0 }" initialization.

> +AVCodec ff_libx265_encoder = {
> +    .name           = "libx265",
> +    .type           = AVMEDIA_TYPE_VIDEO,
> +    .id             = AV_CODEC_ID_HEVC,
> +    .init           = libx265_encode_init,
> +    .encode2        = libx265_encode_frame,
> +    .close          = libx265_encode_close,
> +    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, 
> AV_PIX_FMT_NONE },
> +    .priv_data_size = sizeof(libx265Context),
> +    .long_name      = NULL_IF_CONFIG_SMALL("libx265 H.265 / HEVC"),

Move .long_name after .name.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to