libeplayer3: sync with max_10

Origin commit data
------------------
Branch: master
Commit: 61a2a148d5
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-01-24 (Tue, 24 Jan 2023)

Origin message was:
------------------
- libeplayer3: sync with max_10

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-01-24 21:00:47 +01:00
parent 85d1f1edf4
commit 272d5b11ce
65 changed files with 1100 additions and 959 deletions

View File

@@ -62,8 +62,8 @@ static const uint32 vlce_inter_MCBPC_bits[28] =
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static inline void encode_DC(BW *p, int level, int n)
{
if (level < -255 || level > 255) printf("dc overflow\n");
if (level < -255 || level > 255)
printf("dc overflow\n");
#if 1
level += 256;
if (n < 4)
@@ -75,7 +75,6 @@ static inline void encode_DC(BW *p, int level, int n)
put_bits(p, uni_DCtab_chrom_len[level], uni_DCtab_chrom_bits[level]);
}
#else
int size, v;
/* find number of bits */
size = 0;
@@ -106,17 +105,15 @@ static inline void encode_DC(BW *p, int level, int n)
if (size > 8)
put_bits(p, 1, 1);
}
#endif
}
static inline void encode_escape_3(BW *p, int last, int run, int level)
{
#if 0
put_bits(p,
7 + 2 + 1 + 6 + 1 + 12 + 1, //30bit
(3 << 23) + (3 << 21) + (last << 20) + (run << 14) + (1 << 13) + (((level - 64) & 0xfff) << 1) + 1);
7 + 2 + 1 + 6 + 1 + 12 + 1, //30bit
(3 << 23) + (3 << 21) + (last << 20) + (run << 14) + (1 << 13) + (((level - 64) & 0xfff) << 1) + 1);
#else
put_bits(p, 7, 3); // escape
put_bits(p, 2, 3); // escape3
@@ -271,10 +268,7 @@ esc3:
last_non_zero = i;
}
}
#endif
}
static inline void encode_intra_block(BW *bw, M4V_BLOCK *block, int n)
@@ -312,7 +306,6 @@ static inline void encode_inter_8x8_MCBPC(BW *bw, int cbpc)
put_bits(bw, vlce_inter_MCBPC_bits[cbpc + 16], vlce_inter_MCBPC_code[cbpc + 16]);
}
// same as H.263
static inline void encode_cbpy(BW *bw, int cbpy)
{
@@ -340,7 +333,6 @@ static inline void encode_motion(BW *bw, VLCDEC *mv_x, VLCDEC *mv_y)
{
put_bits(bw, mv_x->bits_ex - 1, mv_x->value_ex >> 1);
}
}
put_vlcdec(bw, mv_y);
if (mv_y->bits_ex)
@@ -371,7 +363,8 @@ static inline void encode_mb_inter_internal(BW *bw, M4V_MICROBLOCK *mb)
cbpy = cbp >> 2;
cbpy ^= 0xF;
if (mb->dquant) cbpc += 8;
if (mb->dquant)
cbpc += 8;
switch (mb->mv_type)
{
@@ -414,12 +407,16 @@ static inline void encode_mb_intra_internal(BW *bw, M4V_MICROBLOCK *mb, int ifra
cbpc = cbp & 3;
if (iframe)
{
if (mb->dquant) cbpc += 4;
if (mb->dquant)
cbpc += 4;
encode_intra_I_MCBPC(bw, cbpc);
}
else
{
if (mb->dquant) cbpc += 8;
if (mb->dquant)
cbpc += 8;
encode_intra_P_MCBPC(bw, cbpc);
}
@@ -430,7 +427,6 @@ static inline void encode_mb_intra_internal(BW *bw, M4V_MICROBLOCK *mb, int ifra
encode_cbpy(bw, cbpy);
encode_dquant(bw, mb->dquant);
for (i = 0; i < 6; i++)
{
encode_intra_block(bw, &mb->block[i], i);
@@ -482,7 +478,9 @@ static inline int encode_vol_header(BW *p, M4V_VOL *vol)
put_bits(p, 2, 0); // shape_type
put_bits(p, 1, 1); // marker
if (vol->time_bits != 5) return -1; // for vop_time_increment_resolution = 30
if (vol->time_bits != 5)
return -1; // for vop_time_increment_resolution = 30
put_bits(p, 16, 30); // *** vop_time_increment_resolution = 30
put_bits(p, 1, 1); // marker
@@ -520,7 +518,6 @@ static inline int encode_vop_header(BW *p, M4V_VOP *vop, int time_bits, int vop_
put_bits(p, 2, vop->picture_type);
// printf("not_code:%d vop_time: %d\n", vop_not_coded, vop->time);
// printf("pic:%d icount:%d vop_time: %d\n", vop->picture_type, time_incr, vop->time);
@@ -619,7 +616,7 @@ static inline int encode_user_header(BW *p)
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void m4v_encode_m4v_header(BW *bw, M4V_VOL *vol, uint32 time)
void m4v_encode_m4v_header(BW *bw, M4V_VOL *vol, uint32 time __attribute__((unused)))
{
encode_vo_header(bw);
encode_vol_header(bw, vol);