Here's a result of sleepless day :). With a small patch to ELBG it was possible to implement simple 15-bit MSVC encoder. At least it can encode more or less recognizable video. Since I have no intentions nor time to polish it, feel free to use it as you like - finish, rework into RPZA encoder, add link to this post to "Interesting patches" on Multimedia Wiki and forget it, whatever. (I should be working on AAC encoder anyway)
On Sun, Jan 25, 2009 at 05:56:28PM +0200, Kostya wrote:
Here's a result of sleepless day :).
With a small patch to ELBG it was possible to implement simple 15-bit MSVC encoder. At least it can encode more or less recognizable video.
Since I have no intentions nor time to polish it, feel free to use it as you like - finish, rework into RPZA encoder, add link to this post to "Interesting patches" on Multimedia Wiki and forget it, whatever.
(I should be working on AAC encoder anyway)
just a quick review (no point in doing a more complete one if noone will work on it ...) [...]
+typedef struct Msvideo1EncContext { + AVCodecContext *avctx; + AVFrame pic; + AVRandomState rnd; + uint8_t *prev; + + int block[16*3]; + int block2[16*3]; + int codebook[8*3]; + int codebook2[8*3]; + int output[16*3]; + int output2[16*3]; + int avg[3]; + int bestpos;
unused
+ int keyint; +} Msvideo1EncContext; + +enum MSV1Mode{ + MODE_SKIP = 0, + MODE_FILL, + MODE_2COL, + MODE_8COL, +}; + +#define SKIP_PREFIX 0x8400 +#define SKIPS_MAX 0x0FFF +#define MKRGB555(in, off) ((in[off] << 10) | (in[off + 1] << 5) | (in[off + 2])) +
+static const int remap[16] = { 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15 };
fits in uint8_t
+ +static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void *data) +{ + Msvideo1EncContext * const c = avctx->priv_data; + AVFrame *pict = data; + AVFrame * const p = &c->pic; + uint16_t *src; + uint8_t *prevptr; + uint8_t *dst = buf;
+ int keyframe = 1;
constant
+ int no_skips = 1; + int i, j, k, x, y; + int skips = 0; +
+ *p = *pict; + if(!c->prev) + c->prev = av_malloc(avctx->width * 3 * (avctx->height + 3)); + prevptr = c->prev + avctx->width * 3 * (((avctx->height + 3)&~3) - 1); + src = (uint16_t*)(p->data[0] + p->linesize[0]*(((avctx->height + 3)&~3) - 1)); + if(c->keyint >= avctx->keyint_min) + keyframe = 1; +
trailing whitespace [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf
On 01/25/2009 04:56 PM, Kostya wrote:
Here's a result of sleepless day :).
With a small patch to ELBG it was possible to implement simple 15-bit MSVC encoder. At least it can encode more or less recognizable video.
Since I have no intentions nor time to polish it, feel free to use it as you like - finish, rework into RPZA encoder, add link to this post to "Interesting patches" on Multimedia Wiki and forget it, whatever.
(I should be working on AAC encoder anyway)
Git-friendly patch attached so patchwork will catch it up. -Vitor
On Sun, Jan 23, 2011 at 04:01:02PM +0100, Vitor Sessak wrote:
Git-friendly patch attached so patchwork will catch it up.
--- /dev/null +++ b/libavcodec/msvideo1enc.c @@ -0,0 +1,297 @@ + +/** + * @file msvideo1enc.c + * Microsoft Video-1 encoder
Scratch the filename.
+/** + * init encoder + */ +static av_cold int encode_init(AVCodecContext *avctx) +{ +} + +/** + * Uninit encoder + */ +static av_cold int encode_end(AVCodecContext *avctx) +{ +}
pointless comments Diego
On Sun, Jan 23, 2011 at 04:01:02PM +0100, Vitor Sessak wrote:
Git-friendly patch attached so patchwork will catch it up.
missing changelog and docs update, version bump Diego
On Sun, Jan 23, 2011 at 04:01:02PM +0100, Vitor Sessak wrote:
On 01/25/2009 04:56 PM, Kostya wrote:
Here's a result of sleepless day :).
With a small patch to ELBG it was possible to implement simple 15-bit MSVC encoder. At least it can encode more or less recognizable video.
Since I have no intentions nor time to polish it, feel free to use it as you like - finish, rework into RPZA encoder, add link to this post to "Interesting patches" on Multimedia Wiki and forget it, whatever.
(I should be working on AAC encoder anyway)
Git-friendly patch attached so patchwork will catch it up.
-Vitor
Makefile | 1 allcodecs.c | 2 elbg.c | 2 msvideo1enc.c | 297 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 300 insertions(+), 2 deletions(-) 249e1aea856912697c992f80a1a1c88827e43bc1 0001-MS-Video-1-encoder.patch From 5fcef6b1e89f7ca4c64fd0279b7db4892c01d8d4 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov <kostya.shishkov@gmail.com> Date: Sun, 23 Jan 2011 15:58:23 +0100 Subject: [PATCH] MS Video 1 encoder
applied with some fixes and regression test [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus
participants (5)
-
diego@biurrun.de -
kostya.shishkov@gmail.com -
Michael Niedermayer -
michaelni@gmx.at -
vitor1001@gmail.com