Unified · Split
| @@ -18,7 +18,7 @@ version next: · 17 unmodified lines | ||
| 18 | 18 | - Automatic thread count based on detection number of (available) CPU cores |
| 19 | 19 | - y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder |
| 20 | 20 | - ffprobe -show_error option |
| 21 | −- Avid 1:1 10-bit RGB Packer decoder | |
| 21 | +- Avid 1:1 10-bit RGB Packer codec | |
| 22 | 22 | - v308 Quicktime Uncompressed 4:4:4 encoder and decoder |
| 23 | 23 | - yuv4 libquicktime packed 4:2:0 encoder and decoder |
| 24 | 24 | - ffprobe -show_frames option |
| @@ -28,6 +28,7 @@ version next: · 3 unmodified lines | ||
| 28 | 28 | - optimized iMDCT transform on x86 using SSE for for mpegaudiodec |
| 29 | 29 | - Improved PGS subtitle decoder |
| 30 | 30 | - dumpgraph option to lavfi device |
| 31 | +- r210 and r10k encoders | |
| 31 | 32 | |
| 32 | 33 | |
| 33 | 34 | version 0.9: |
| @@ -440,7 +440,7 @@ following image formats are supported: · 439 unmodified lines | ||
| 440 | 440 | @item Autodesk Animator Flic video @tab @tab X |
| 441 | 441 | @item Autodesk RLE @tab @tab X |
| 442 | 442 | @tab fourcc: AASC |
| 443 | −@item Avid 1:1 10-bit RGB Packer @tab @tab X | |
| 443 | +@item Avid 1:1 10-bit RGB Packer @tab X @tab X | |
| 444 | 444 | @tab fourcc: AVrp |
| 445 | 445 | @item AVS (Audio Video Standard) video @tab @tab X |
| 446 | 446 | @tab Video encoding used by the Creature Shock game. |
| @@ -577,8 +577,8 @@ following image formats are supported: · 130 unmodified lines | ||
| 577 | 577 | @tab fourcc: 'smc ' |
| 578 | 578 | @item QuickTime video (RPZA) @tab @tab X |
| 579 | 579 | @tab fourcc: rpza |
| 580 | −@item R10K AJA Kona 10-bit RGB Codec @tab @tab X | |
| 581 | −@item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X | |
| 580 | +@item R10K AJA Kona 10-bit RGB Codec @tab X @tab X | |
| 581 | +@item R210 Quicktime Uncompressed RGB 10-bit @tab X @tab X | |
| 582 | 582 | @item Raw Video @tab X @tab X |
| 583 | 583 | @item RealVideo 1.0 @tab X @tab X |
| 584 | 584 | @item RealVideo 2.0 @tab X @tab X |
| @@ -92,6 +92,7 @@ OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o · 91 unmodified lines | ||
| 92 | 92 | OBJS-$(CONFIG_AURA_DECODER) += cyuv.o |
| 93 | 93 | OBJS-$(CONFIG_AURA2_DECODER) += aura.o |
| 94 | 94 | OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o |
| 95 | +OBJS-$(CONFIG_AVRP_ENCODER) += r210enc.o | |
| 95 | 96 | OBJS-$(CONFIG_AVS_DECODER) += avs.o |
| 96 | 97 | OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o |
| 97 | 98 | OBJS-$(CONFIG_BFI_DECODER) += bfi.o |
| @@ -339,7 +340,9 @@ OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o · 241 unmodified lines | ||
| 339 | 340 | OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o |
| 340 | 341 | OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o |
| 341 | 342 | OBJS-$(CONFIG_R10K_DECODER) += r210dec.o |
| 343 | +OBJS-$(CONFIG_R10K_ENCODER) += r210enc.o | |
| 342 | 344 | OBJS-$(CONFIG_R210_DECODER) += r210dec.o |
| 345 | +OBJS-$(CONFIG_R210_ENCODER) += r210enc.o | |
| 343 | 346 | OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o |
| 344 | 347 | OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o |
| 345 | 348 | OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o |
| @@ -79,7 +79,7 @@ void avcodec_register_all(void) · 78 unmodified lines | ||
| 79 | 79 | REGISTER_ENCDEC (ASV2, asv2); |
| 80 | 80 | REGISTER_DECODER (AURA, aura); |
| 81 | 81 | REGISTER_DECODER (AURA2, aura2); |
| 82 | − REGISTER_DECODER (AVRP, avrp); | |
| 82 | + REGISTER_ENCDEC (AVRP, avrp); | |
| 83 | 83 | REGISTER_DECODER (AVS, avs); |
| 84 | 84 | REGISTER_DECODER (BETHSOFTVID, bethsoftvid); |
| 85 | 85 | REGISTER_DECODER (BFI, bfi); |
| @@ -184,8 +184,8 @@ void avcodec_register_all(void) · 98 unmodified lines | ||
| 184 | 184 | REGISTER_DECODER (QDRAW, qdraw); |
| 185 | 185 | REGISTER_DECODER (QPEG, qpeg); |
| 186 | 186 | REGISTER_ENCDEC (QTRLE, qtrle); |
| 187 | − REGISTER_DECODER (R10K, r10k); | |
| 188 | − REGISTER_DECODER (R210, r210); | |
| 187 | + REGISTER_ENCDEC (R10K, r10k); | |
| 188 | + REGISTER_ENCDEC (R210, r210); | |
| 189 | 189 | REGISTER_ENCDEC (RAWVIDEO, rawvideo); |
| 190 | 190 | REGISTER_DECODER (RL2, rl2); |
| 191 | 191 | REGISTER_ENCDEC (ROQ, roq); |
| @@ -0,0 +1,120 @@ | ||
| 1 | +/* | |
| 2 | + * R210 encoder | |
| 3 | + * | |
| 4 | + * Copyright (c) 2012 Paul B Mahol | |
| 5 | + * | |
| 6 | + * This file is part of FFmpeg. | |
| 7 | + * | |
| 8 | + * FFmpeg is free software; you can redistribute it and/or | |
| 9 | + * modify it under the terms of the GNU Lesser General Public | |
| 10 | + * License as published by the Free Software Foundation; either | |
| 11 | + * version 2.1 of the License, or (at your option) any later version. | |
| 12 | + * | |
| 13 | + * FFmpeg is distributed in the hope that it will be useful, | |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 16 | + * Lesser General Public License for more details. | |
| 17 | + * | |
| 18 | + * You should have received a copy of the GNU Lesser General Public | |
| 19 | + * License along with FFmpeg; if not, write to the Free Software | |
| 20 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 21 | + */ | |
| 22 | + | |
| 23 | +#include "avcodec.h" | |
| 24 | +#include "bytestream.h" | |
| 25 | + | |
| 26 | +static av_cold int encode_init(AVCodecContext *avctx) | |
| 27 | +{ | |
| 28 | + avctx->coded_frame = avcodec_alloc_frame(); | |
| 29 | + | |
| 30 | + if (!avctx->coded_frame) | |
| 31 | + return AVERROR(ENOMEM); | |
| 32 | + | |
| 33 | + return 0; | |
| 34 | +} | |
| 35 | + | |
| 36 | +static int encode_frame(AVCodecContext *avctx, uint8_t *buf, | |
| 37 | + int buf_size, void *data) | |
| 38 | +{ | |
| 39 | + AVFrame *pic = data; | |
| 40 | + int i, j; | |
| 41 | + int aligned_width = FFALIGN(avctx->width, 64); | |
| 42 | + uint8_t *src_line; | |
| 43 | + uint8_t *dst = buf; | |
| 44 | + | |
| 45 | + if (buf_size < 4 * aligned_width * avctx->height) { | |
| 46 | + av_log(avctx, AV_LOG_ERROR, "output buffer too small\n"); | |
| 47 | + return AVERROR(ENOMEM); | |
| 48 | + } | |
| 49 | + | |
| 50 | + avctx->coded_frame->reference = 0; | |
| 51 | + avctx->coded_frame->key_frame = 1; | |
| 52 | + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; | |
| 53 | + src_line = pic->data[0]; | |
| 54 | + | |
| 55 | + for (i = 0; i < avctx->height; i++) { | |
| 56 | + uint16_t *src = (uint16_t *)src_line; | |
| 57 | + for (j = 0; j < avctx->width; j++) { | |
| 58 | + uint32_t pixel; | |
| 59 | + uint16_t r = *src++ >> 6; | |
| 60 | + uint16_t g = *src++ >> 6; | |
| 61 | + uint16_t b = *src++ >> 4; | |
| 62 | + if (avctx->codec_id == CODEC_ID_R210) | |
| 63 | + pixel = (r << 20) | (g << 10) | b >> 2; | |
| 64 | + else | |
| 65 | + pixel = (r << 22) | (g << 12) | b; | |
| 66 | + if (avctx->codec_id == CODEC_ID_AVRP) | |
| 67 | + bytestream_put_le32(&dst, pixel); | |
| 68 | + else | |
| 69 | + bytestream_put_be32(&dst, pixel); | |
| 70 | + } | |
| 71 | + dst += aligned_width - avctx->width; | |
| 72 | + src_line += pic->linesize[0]; | |
| 73 | + } | |
| 74 | + | |
| 75 | + return 4 * aligned_width * avctx->height; | |
| 76 | +} | |
| 77 | + | |
| 78 | +static av_cold int encode_close(AVCodecContext *avctx) | |
| 79 | +{ | |
| 80 | + av_freep(&avctx->coded_frame); | |
| 81 | + | |
| 82 | + return 0; | |
| 83 | +} | |
| 84 | + | |
| 85 | +#if CONFIG_R210_ENCODER | |
| 86 | +AVCodec ff_r210_encoder = { | |
| 87 | + .name = "r210", | |
| 88 | + .type = AVMEDIA_TYPE_VIDEO, | |
| 89 | + .id = CODEC_ID_R210, | |
| 90 | + .init = encode_init, | |
| 91 | + .encode = encode_frame, | |
| 92 | + .close = encode_close, | |
| 93 | + .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_RGB48, PIX_FMT_NONE }, | |
| 94 | + .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), | |
| 95 | +}; | |
| 96 | +#endif | |
| 97 | +#if CONFIG_R10K_ENCODER | |
| 98 | +AVCodec ff_r10k_encoder = { | |
| 99 | + .name = "r10k", | |
| 100 | + .type = AVMEDIA_TYPE_VIDEO, | |
| 101 | + .id = CODEC_ID_R10K, | |
| 102 | + .init = encode_init, | |
| 103 | + .encode = encode_frame, | |
| 104 | + .close = encode_close, | |
| 105 | + .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_RGB48, PIX_FMT_NONE }, | |
| 106 | + .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), | |
| 107 | +}; | |
| 108 | +#endif | |
| 109 | +#if CONFIG_AVRP_ENCODER | |
| 110 | +AVCodec ff_avrp_encoder = { | |
| 111 | + .name = "avrp", | |
| 112 | + .type = AVMEDIA_TYPE_VIDEO, | |
| 113 | + .id = CODEC_ID_AVRP, | |
| 114 | + .init = encode_init, | |
| 115 | + .encode = encode_frame, | |
| 116 | + .close = encode_close, | |
| 117 | + .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_RGB48, PIX_FMT_NONE }, | |
| 118 | + .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), | |
| 119 | +}; | |
| 120 | +#endif | |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #define AVCODEC_VERSION_H |
| 22 | 22 | |
| 23 | 23 | #define LIBAVCODEC_VERSION_MAJOR 53 |
| 24 | −#define LIBAVCODEC_VERSION_MINOR 59 | |
| 24 | +#define LIBAVCODEC_VERSION_MINOR 60 | |
| 25 | 25 | #define LIBAVCODEC_VERSION_MICRO 100 |
| 26 | 26 | |
| 27 | 27 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |