You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
dpcm: misc pretty-printing
This commit is contained in:
@ -84,13 +84,15 @@ static const int interplay_delta_table[] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int sol_table_old[16] =
|
static const int sol_table_old[16] = {
|
||||||
{ 0x0, 0x1, 0x2 , 0x3, 0x6, 0xA, 0xF, 0x15,
|
0x0, 0x1, 0x2, 0x3, 0x6, 0xA, 0xF, 0x15,
|
||||||
-0x15, -0xF, -0xA, -0x6, -0x3, -0x2, -0x1, 0x0};
|
-0x15, -0xF, -0xA, -0x6, -0x3, -0x2, -0x1, 0x0
|
||||||
|
};
|
||||||
|
|
||||||
static const int sol_table_new[16] =
|
static const int sol_table_new[16] = {
|
||||||
{ 0x0, 0x1, 0x2, 0x3, 0x6, 0xA, 0xF, 0x15,
|
0x0, 0x1, 0x2, 0x3, 0x6, 0xA, 0xF, 0x15,
|
||||||
0x0, -0x1, -0x2, -0x3, -0x6, -0xA, -0xF, -0x15};
|
0x0, -0x1, -0x2, -0x3, -0x6, -0xA, -0xF, -0x15
|
||||||
|
};
|
||||||
|
|
||||||
static const int sol_table_16[128] = {
|
static const int sol_table_16[128] = {
|
||||||
0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
|
0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
|
||||||
@ -109,7 +111,6 @@ static const int sol_table_16[128] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static av_cold int dpcm_decode_init(AVCodecContext *avctx)
|
static av_cold int dpcm_decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
DPCMContext *s = avctx->priv_data;
|
DPCMContext *s = avctx->priv_data;
|
||||||
@ -125,24 +126,23 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
|
|||||||
/* initialize square table */
|
/* initialize square table */
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
square = i * i;
|
square = i * i;
|
||||||
s->roq_square_array[i] = square;
|
s->roq_square_array[i ] = square;
|
||||||
s->roq_square_array[i + 128] = -square;
|
s->roq_square_array[i + 128] = -square;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case CODEC_ID_SOL_DPCM:
|
case CODEC_ID_SOL_DPCM:
|
||||||
switch(avctx->codec_tag){
|
switch(avctx->codec_tag){
|
||||||
case 1:
|
case 1:
|
||||||
s->sol_table=sol_table_old;
|
s->sol_table = sol_table_old;
|
||||||
s->sample[0] = s->sample[1] = 0x80;
|
s->sample[0] = s->sample[1] = 0x80;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
s->sol_table=sol_table_new;
|
s->sol_table = sol_table_new;
|
||||||
s->sample[0] = s->sample[1] = 0x80;
|
s->sample[0] = s->sample[1] = 0x80;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
s->sol_table=sol_table_16;
|
s->sol_table = sol_table_16;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unknown SOL subcodec\n");
|
av_log(avctx, AV_LOG_ERROR, "Unknown SOL subcodec\n");
|
||||||
@ -162,8 +162,8 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dpcm_decode_frame(AVCodecContext *avctx,
|
|
||||||
void *data, int *data_size,
|
static int dpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
||||||
AVPacket *avpkt)
|
AVPacket *avpkt)
|
||||||
{
|
{
|
||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
|
Reference in New Issue
Block a user