Captain Jack
Burnt out human
- Joined
- Oct 21, 2006
- Messages
- 11,808
- Reaction score
- 7,991
- Points
- 113
- My Satellite Setup
- See signature
- My Location
- North Somerset
Love this bit of code
Real-time Videocrypt encoder ;) Cut-point range on the 'real' encoder is I think between 20 and 236, instead of 1 to 255 (or 1 to active_width) but that's a moot point at this stage. Nice work!
Code:
/* Simulated line cut-and-rotate video scrambling */
if(seq[2] == 'a' && seq[3] == 'a')
{
int c1 = rand() % s->active_width;
int c2 = s->active_width - c1 - 1;
for(x = s->active_left; x < s->active_left + c2; x++)
{
s->output[x * 2 + 1] = s->output[(x + c1) * 2];
}
for(; x < s->active_left + s->active_width; x++)
{
s->output[x * 2 + 1] = s->output[(x - c2) * 2];
}
for(x = s->active_left; x < s->active_left + s->active_width; x++)
{
s->output[x * 2] = s->output[x * 2 + 1];
}
}
Real-time Videocrypt encoder ;) Cut-point range on the 'real' encoder is I think between 20 and 236, instead of 1 to 255 (or 1 to active_width) but that's a moot point at this stage. Nice work!