1
/***************************************************************************
3
** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C
4
** > Software Release 2.1 (2008-06)
5
** (Simple repackaging; no change from 2005-05 Release 2.0 code)
7
** � 2004 Polycom, Inc.
9
** All rights reserved.
11
***************************************************************************/
13
/***************************************************************************
16
Purpose: Contains files used to implement the G.722.1 Annex C decoder
20
***************************************************************************/
22
/***************************************************************************
24
***************************************************************************/
31
/***************************************************************************
34
Syntax: void decoder(Bit_Obj *bitobj,
36
Word16 number_of_regions,
37
Word16 *decoder_mlt_coefs,
39
Word16 *p_old_mag_shift,
40
Word16 *old_decoder_mlt_coefs,
41
Word16 frame_error_flag)
43
inputs: Bit_Obj *bitobj
45
Word16 number_of_regions
46
Word16 *p_old_mag_shift
47
Word16 *old_decoder_mlt_coefs
48
Word16 frame_error_flag
50
outputs: Word16 *decoder_mlt_coefs,
55
Description: Decodes the out_words into mlt coefs using G.722.1 Annex C
59
WMOPS: 7kHz | 24kbit | 32kbit
60
-------|-------------|----------------
62
-------|-------------|----------------
64
-------|-------------|----------------
66
14kHz | 24kbit | 32kbit | 48kbit
67
-------|-------------|----------------|----------------
68
AVG | 1.31 | 1.56 | 1.88
69
-------|-------------|----------------|----------------
70
MAX | 1.59 | 1.80 | 1.98
71
-------|-------------|----------------|----------------
73
***************************************************************************/
74
void decoder(Bit_Obj *bitobj,
76
Word16 number_of_regions,
77
Word16 *decoder_mlt_coefs,
79
Word16 *p_old_mag_shift,
80
Word16 *old_decoder_mlt_coefs,
81
Word16 frame_error_flag)
85
Word16 absolute_region_power_index[MAX_NUMBER_OF_REGIONS];
86
Word16 decoder_power_categories[MAX_NUMBER_OF_REGIONS];
87
Word16 decoder_category_balances[MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES-1];
88
UWord16 categorization_control;
89
Word16 decoder_region_standard_deviation[MAX_NUMBER_OF_REGIONS];
92
Word16 num_categorization_control_bits;
93
Word16 num_categorization_control_possibilities;
94
Word16 number_of_coefs;
95
Word16 number_of_valid_coefs;
99
if (number_of_regions==NUMBER_OF_REGIONS)
101
num_categorization_control_bits = NUM_CATEGORIZATION_CONTROL_BITS;
103
num_categorization_control_possibilities = NUM_CATEGORIZATION_CONTROL_POSSIBILITIES;
105
number_of_coefs = DCT_LENGTH;
107
number_of_valid_coefs = NUMBER_OF_VALID_COEFS;
112
num_categorization_control_bits = MAX_NUM_CATEGORIZATION_CONTROL_BITS;
114
num_categorization_control_possibilities = MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES;
116
number_of_coefs = MAX_DCT_LENGTH;
118
number_of_valid_coefs = MAX_NUMBER_OF_VALID_COEFS;
123
if (frame_error_flag == 0)
126
/* convert the bits to absolute region power index and decoder_region_standard_deviation */
128
decode_envelope(bitobj,
130
decoder_region_standard_deviation,
131
absolute_region_power_index,
134
/* fill the categorization_control with NUM_CATEGORIZATION_CONTROL_BITS */
135
categorization_control = 0;
136
for (i=0; i<num_categorization_control_bits; i++)
138
get_next_bit(bitobj);
139
categorization_control = shl_nocheck(categorization_control,1);
140
categorization_control = add(categorization_control,bitobj->next_bit);
143
bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,num_categorization_control_bits);
145
/* obtain decoder power categories and category balances */
146
/* based on the absolute region power index */
147
categorize(bitobj->number_of_bits_left,
149
num_categorization_control_possibilities,
150
absolute_region_power_index,
151
decoder_power_categories,
152
decoder_category_balances);
154
/* perform adjustmaents to the power categories and category balances based on the cat control */
155
rate_adjust_categories(categorization_control,
156
decoder_power_categories,
157
decoder_category_balances);
159
/* decode the quantized bits into mlt coefs */
160
decode_vector_quantized_mlt_indices(bitobj,
163
decoder_region_standard_deviation,
164
decoder_power_categories,
167
/* test for frame errors */
168
test_4_frame_errors(bitobj,
170
num_categorization_control_possibilities,
172
categorization_control,
173
absolute_region_power_index);
176
/* perform error handling operations */
177
error_handling(number_of_coefs,
178
number_of_valid_coefs,
181
old_decoder_mlt_coefs,
187
/***************************************************************************
188
Function: decode_envelope
190
Syntax: void decode_envelope(Bit_Obj *bitobj,
191
Word16 number_of_regions,
192
Word16 *decoder_region_standard_deviation,
193
Word16 *absolute_region_power_index,
196
inputs: Bit_Obj *bitobj
197
Word16 number_of_regions
200
outputs: Word16 *decoder_region_standard_deviation
201
Word16 *absolute_region_power_index
205
Description: Recover differential_region_power_index from code bits
209
WMOPS: 7kHz | 24kbit | 32kbit
210
-------|--------------|----------------
212
-------|--------------|----------------
214
-------|--------------|----------------
216
14kHz | 24kbit | 32kbit | 48kbit
217
-------|--------------|----------------|----------------
218
AVG | 0.08 | 0.08 | 0.08
219
-------|--------------|----------------|----------------
220
MAX | 0.10 | 0.10 | 0.10
221
-------|--------------|----------------|----------------
223
***************************************************************************/
224
void decode_envelope(Bit_Obj *bitobj,
225
Word16 number_of_regions,
226
Word16 *decoder_region_standard_deviation,
227
Word16 *absolute_region_power_index,
234
Word16 differential_region_power_index[MAX_NUMBER_OF_REGIONS];
245
/* get 5 bits from the current code word */
248
get_next_bit(bitobj);
249
index = shl_nocheck(index,1);
250
index = add(index,bitobj->next_bit);
252
bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,5);
254
/* ESF_ADJUSTMENT_TO_RMS_INDEX compensates for the current (9/30/96)
255
IMLT being scaled to high by the ninth power of sqrt(2). */
256
differential_region_power_index[0] = sub(index,ESF_ADJUSTMENT_TO_RMS_INDEX);
259
/* obtain differential_region_power_index */
260
for (region=1; region<number_of_regions; region++)
266
get_next_bit(bitobj);
268
if (bitobj->next_bit == 0)
270
index = differential_region_power_decoder_tree[region][index][0];
275
index = differential_region_power_decoder_tree[region][index][1];
278
bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1);
282
differential_region_power_index[region] = negate(index);
286
/* Reconstruct absolute_region_power_index[] from differential_region_power_index[]. */
287
absolute_region_power_index[0] = differential_region_power_index[0];
289
for (region=1; region<number_of_regions; region++)
291
acca = L_add(absolute_region_power_index[region-1],differential_region_power_index[region]);
292
acca = L_add(acca,DRP_DIFF_MIN);
293
absolute_region_power_index[region] = extract_l(acca);
296
/* Reconstruct decoder_region_standard_deviation[] from absolute_region_power_index[]. */
297
/* DEBUG!!!! - This integer method jointly computes the mag_shift
298
and the standard deviations already mag_shift compensated. It
299
relies on REGION_POWER_STEPSIZE_DB being exactly 3.010299957 db
300
or a square root of 2 chnage in standard deviation. If
301
REGION_POWER_STEPSIZE_DB changes, this software must be
308
for (region=0; region<number_of_regions; region++)
310
acca = L_add(absolute_region_power_index[region],REGION_POWER_TABLE_NUM_NEGATIVES);
313
temp1 = sub(i,max_index);
320
temp = add(temp,int_region_standard_deviation_table[i]);
326
temp2 = sub(max_index,28);
332
while ((i >= 0) && ((temp1 >= 0) || (temp2 > 0)))
335
temp = shr_nocheck(temp,1);
336
max_index = sub(max_index,2);
338
temp2 = sub(max_index,28);
349
/* pointer arithmetic */
350
temp = (Word16 )(REGION_POWER_TABLE_NUM_NEGATIVES + (*p_mag_shift * 2));
352
for (region=0; region<number_of_regions; region++)
354
acca = L_add(absolute_region_power_index[region],temp);
356
decoder_region_standard_deviation[region] = int_region_standard_deviation_table[i];
362
/***************************************************************************
363
Function: rate_adjust_categories
365
Syntax: void rate_adjust_categories(Word16 categorization_control,
366
Word16 *decoder_power_categories,
367
Word16 *decoder_category_balances)
369
inputs: Word16 categorization_control,
370
Word16 *decoder_power_categories,
371
Word16 *decoder_category_balances
373
outputs: Word16 categorization_control,
374
Word16 *decoder_power_categories,
376
Description: Adjust the power categories based on the categorization control
380
WMOPS: 7kHz | 24kbit | 32kbit
381
-------|--------------|----------------
383
-------|--------------|----------------
385
-------|--------------|----------------
387
14kHz | 24kbit | 32kbit | 48kbit
388
-------|--------------|----------------|----------------
389
AVG | 0.00 | 0.00 | 0.00
390
-------|--------------|----------------|----------------
391
MAX | 0.01 | 0.01 | 0.01
392
-------|--------------|----------------|----------------
394
***************************************************************************/
395
void rate_adjust_categories(Word16 categorization_control,
396
Word16 *decoder_power_categories,
397
Word16 *decoder_category_balances)
406
while (categorization_control > 0)
408
region = decoder_category_balances[i++];
410
decoder_power_categories[region] = add(decoder_power_categories[region],1);
412
categorization_control = sub(categorization_control,1);
417
/***************************************************************************
418
Function: decode_vector_quantized_mlt_indices
420
Syntax: void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj,
422
Word16 number_of_regions,
423
Word16 *decoder_region_standard_deviation,
424
Word16 *decoder_power_categories,
425
Word16 *decoder_mlt_coefs)
426
inputs: Bit_Obj *bitobj
428
Word16 number_of_regions
429
Word16 *decoder_region_standard_deviation
430
Word16 *decoder_power_categories
433
outputs: Word16 *decoder_mlt_coefs
436
Description: Decode MLT coefficients
440
WMOPS: 7kHz | 24kbit | 32kbit
441
-------|--------------|----------------
443
-------|--------------|----------------
445
-------|--------------|----------------
447
14kHz | 24kbit | 32kbit | 48kbit
448
-------|--------------|----------------|----------------
449
AVG | 0.77 | 0.98 | 1.28
450
-------|--------------|----------------|----------------
451
MAX | 1.05 | 1.18 | 1.36
452
-------|--------------|----------------|----------------
454
***************************************************************************/
455
void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj,
457
Word16 number_of_regions,
458
Word16 *decoder_region_standard_deviation,
459
Word16 *decoder_power_categories,
460
Word16 *decoder_mlt_coefs)
462
Word16 standard_deviation;
463
Word16 *decoder_mlt_ptr;
464
Word16 decoder_mlt_value;
467
Word16 noise_fill_factor[3] = {5793,8192,23170};
471
Word16 k[MAX_VECTOR_DIMENSION];
476
Word16 signs_index=0;
477
Word16 num_sign_bits;
478
Word16 ran_out_of_bits_flag;
479
Word16 *decoder_table_ptr;
486
ran_out_of_bits_flag = 0;
489
for (region=0; region<number_of_regions; region++)
491
category = (Word16)decoder_power_categories[region];
493
acca = L_mult0(region,REGION_SIZE);
494
index = extract_l(acca);
495
decoder_mlt_ptr = &decoder_mlt_coefs[index];
497
standard_deviation = decoder_region_standard_deviation[region];
500
temp = sub(category,7);
504
/* Get the proper table of decoder tables, vec_dim, and num_vecs for the cat */
505
decoder_table_ptr = (Word16 *) table_of_decoder_tables[category];
507
vec_dim = vector_dimension[category];
509
num_vecs = number_of_vectors[category];
512
for (n=0; n<num_vecs; n++)
521
if (bitobj->number_of_bits_left <= 0)
523
ran_out_of_bits_flag = 1;
528
get_next_bit(bitobj);
531
if (bitobj->next_bit == 0)
533
temp = shl_nocheck(index,1);
534
index = (Word16)*(decoder_table_ptr + temp);
539
temp = shl_nocheck(index,1);
540
index = (Word16)*(decoder_table_ptr + temp + 1);
543
bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1);
549
if (ran_out_of_bits_flag != 0)
552
index = negate(index);
554
/* convert index into array used to access the centroid table */
555
/* get the number of sign bits in the index */
556
num_sign_bits = index_to_array(index,k,category);
558
temp = sub(bitobj->number_of_bits_left,num_sign_bits);
564
if (num_sign_bits != 0)
568
for (j=0; j<num_sign_bits; j++)
570
get_next_bit(bitobj);
571
signs_index = shl_nocheck(signs_index,1);
572
signs_index = add(signs_index,bitobj->next_bit);
573
bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1);
575
temp = sub(num_sign_bits,1);
576
bit = shl_nocheck(1,(temp));
579
for (j=0; j<vec_dim; j++)
581
acca = L_mult0(standard_deviation,mlt_quant_centroid[category][k[j]]);
582
acca = L_shr_nocheck(acca,12);
583
decoder_mlt_value = extract_l(acca);
586
if (decoder_mlt_value != 0)
589
if ((signs_index & bit) == 0)
590
decoder_mlt_value = negate(decoder_mlt_value);
591
bit = shr_nocheck(bit,1);
593
*decoder_mlt_ptr++ = decoder_mlt_value;
599
ran_out_of_bits_flag = 1;
604
/* If ran out of bits during decoding do noise fill for remaining regions. */
605
/* DEBUG!! - For now also redo all of last region with all noise fill. */
607
if (ran_out_of_bits_flag != 0)
609
temp = add(region,1);
610
for (j=temp; j<number_of_regions; j++)
612
decoder_power_categories[j] = 7;
617
decoder_mlt_ptr = &decoder_mlt_coefs[region*REGION_SIZE];
622
temp = sub(category,5);
623
temp1 = sub(category,6);
627
if ((temp == 0) || (temp1 == 0))
630
decoder_mlt_ptr = &decoder_mlt_coefs[region*REGION_SIZE];
632
noifillpos = mult(standard_deviation,noise_fill_factor[category - 5]);
633
noifillneg = negate(noifillpos);
635
random_word = get_rand(randobj);
640
if (*decoder_mlt_ptr == 0)
644
if ((random_word & 1) == 0)
654
*decoder_mlt_ptr = temp1;
656
random_word = shr_nocheck(random_word,1);
658
/* pointer arithmetic */
661
random_word = get_rand(randobj);
665
if (*decoder_mlt_ptr == 0)
669
if ((random_word & 1) == 0)
679
*decoder_mlt_ptr = temp1;
681
random_word = shr_nocheck(random_word,1);
683
/* pointer arithmetic */
688
/* if (category == 7) */
689
temp1 = sub(category,7);
693
index = sub(category,5);
694
noifillpos = mult(standard_deviation,noise_fill_factor[index]);
695
noifillneg = negate(noifillpos);
697
random_word = get_rand(randobj);
702
if ((random_word & 1) == 0)
712
*decoder_mlt_ptr++ = temp1;
714
random_word = shr_nocheck(random_word,1);
716
random_word = get_rand(randobj);
721
if ((random_word & 1) == 0)
732
*decoder_mlt_ptr++ = temp1;
734
random_word = shr_nocheck(random_word,1);
740
if (ran_out_of_bits_flag)
741
bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1);
743
/****************************************************************************************
744
Function: index_to_array
746
Syntax: number_of_non_zero = index_to_array(Word16 index,
747
Word16 array[MAX_VECTOR_DIMENSION],
753
outputs: Word16 array[MAX_VECTOR_DIMENSION] - used in decoder to access
754
mlt_quant_centroid table
756
Word16 number_of_non_zero - number of non zero elements
759
Description: Computes an array of sign bits with the length of the category vector
760
Returns the number of sign bits and the array
762
WMOPS: 7kHz | 24kbit | 32kbit
763
-------|--------------|----------------
765
-------|--------------|----------------
767
-------|--------------|----------------
769
14kHz | 24kbit | 32kbit | 48kbit
770
-------|--------------|----------------|----------------
771
AVG | 0.00 | 0.00 | 0.00
772
-------|--------------|----------------|----------------
773
MAX | 0.00 | 0.00 | 0.00
774
-------|--------------|----------------|----------------
776
****************************************************************************************/
777
Word16 index_to_array(Word16 index,Word16 *array,Word16 category)
780
Word16 number_of_non_zero;
781
Word16 max_bin_plus_one;
782
Word16 inverse_of_max_bin_plus_one;
785
number_of_non_zero = 0;
791
max_bin_plus_one = add(max_bin[category],1);
792
inverse_of_max_bin_plus_one = max_bin_plus_one_inverse[category];
795
temp = sub(vector_dimension[category],1);
796
for (j=temp; j>=0; j--)
798
q = mult(p,inverse_of_max_bin_plus_one);
799
temp = extract_l(L_mult0(q,max_bin_plus_one));
800
array[j] = sub(p,temp);
810
number_of_non_zero = add(number_of_non_zero,1);
812
return(number_of_non_zero);
814
/***************************************************************************
815
Function: test_4_frame_errors
817
Syntax: void test_4_frame_errors(Bit_Obj *bitobj,
818
Word16 number_of_regions,
819
Word16 num_categorization_control_possibilities,
820
Word16 *frame_error_flag,
821
Word16 categorization_control,
822
Word16 *absolute_region_power_index)
826
num_categorization_control_possibilities
828
categorization_control
829
absolute_region_power_index
832
outputs: frame_error_flag
837
Description: Tests for error conditions and sets the frame_error_flag accordingly
841
WMOPS: 7kHz | 24kbit | 32kbit
842
-------|--------------|----------------
844
-------|--------------|----------------
846
-------|--------------|----------------
848
14kHz | 24kbit | 32kbit | 48kbit
849
-------|--------------|----------------|----------------
850
AVG | 0.01 | 0.01 | 0.01
851
-------|--------------|----------------|----------------
852
MAX | 0.02 | 0.06 | 0.08
853
-------|--------------|----------------|----------------
855
***************************************************************************/
856
void test_4_frame_errors(Bit_Obj *bitobj,
857
Word16 number_of_regions,
858
Word16 num_categorization_control_possibilities,
859
Word16 *frame_error_flag,
860
Word16 categorization_control,
861
Word16 *absolute_region_power_index)
869
/* Test for bit stream errors. */
872
if (bitobj->number_of_bits_left > 0)
874
for (i=0; i<bitobj->number_of_bits_left; i++)
876
get_next_bit(bitobj);
878
if (bitobj->next_bit == 0)
880
*frame_error_flag = 1;
887
temp = sub(categorization_control,sub(num_categorization_control_possibilities,1));
892
if (bitobj->number_of_bits_left < 0)
894
*frame_error_flag |= 2;
900
/* checks to ensure that abs_region_power_index is within range */
901
/* the error flag is set if it is out of range */
902
for (region=0; region<number_of_regions; region++)
904
/* the next two lines of comments were modified in release 1.2
905
* to correct the description of the range of
906
* absolute_region_power_index[] to be tested in the next
909
/* if ((absolute_region_power_index[region] > 31) ||
910
(absolute_region_power_index[region] < -8) */
912
acca = L_add(absolute_region_power_index[region],ESF_ADJUSTMENT_TO_RMS_INDEX);
913
accb = L_sub(acca,31);
914
acca = L_add(acca,8);
917
/* the next line was modifed in release 1.2 to
918
* correct miss typed code and error checking.
920
if ((accb > 0) || (acca < 0))
922
*frame_error_flag |= 4;
928
/***************************************************************************
929
Function: error_handling
931
Syntax: void error_handling(Word16 number_of_coefs,
932
Word16 number_of_valid_coefs,
933
Word16 *frame_error_flag,
934
Word16 *decoder_mlt_coefs,
935
Word16 *old_decoder_mlt_coefs,
937
Word16 *p_old_mag_shift)
939
inputs: number_of_coefs
940
number_of_valid_coefs
942
old_decoder_mlt_coefs
946
outputs: decoder_mlt_coefs
947
old_decoder_mlt_coefs
953
Description: If both the current and previous frames are errored,
954
set the mlt coefficients to 0. If only the current frame
955
is errored, then repeat the previous frame's mlt coefficients.
959
WMOPS: 7kHz | 24kbit | 32kbit
960
-------|--------------|----------------
962
-------|--------------|----------------
964
-------|--------------|----------------
966
14kHz | 24kbit | 32kbit | 48kbit
967
-------|--------------|----------------|----------------
968
AVG | 0.03 | 0.03 | 0.03
969
-------|--------------|----------------|----------------
970
MAX | 0.03 | 0.03 | 0.06
971
-------|--------------|----------------|----------------
973
***************************************************************************/
974
void error_handling(Word16 number_of_coefs,
975
Word16 number_of_valid_coefs,
976
Word16 *frame_error_flag,
977
Word16 *decoder_mlt_coefs,
978
Word16 *old_decoder_mlt_coefs,
980
Word16 *p_old_mag_shift)
985
if (*frame_error_flag != 0)
988
for (i = 0; i < number_of_valid_coefs; i++)
990
decoder_mlt_coefs[i] = old_decoder_mlt_coefs[i];
994
for (i = 0; i < number_of_valid_coefs; i++)
996
old_decoder_mlt_coefs[i] = 0;
1000
*p_mag_shift = *p_old_mag_shift;
1003
*p_old_mag_shift = 0;
1008
/* Store in case next frame is errored. */
1009
for (i = 0; i < number_of_valid_coefs; i++)
1011
old_decoder_mlt_coefs[i] = decoder_mlt_coefs[i];
1015
*p_old_mag_shift = *p_mag_shift;
1020
/* Zero out the upper 1/8 of the spectrum. */
1021
for (i = number_of_valid_coefs; i < number_of_coefs; i++)
1023
decoder_mlt_coefs[i] = 0;
1028
/****************************************************************************************
1029
Function: get_next_bit
1031
Syntax: void get_next_bit(Bit_Obj *bitobj)
1033
Description: Returns the next bit in the current word inside the bit object
1035
WMOPS: 7kHz | 24kbit | 32kbit
1036
-------|--------------|----------------
1038
-------|--------------|----------------
1040
-------|--------------|----------------
1042
14kHz | 24kbit | 32kbit | 48kbit
1043
-------|--------------|----------------|----------------
1044
AVG | 0.00 | 0.00 | 0.00
1045
-------|--------------|----------------|----------------
1046
MAX | 0.00 | 0.00 | 0.00
1047
-------|--------------|----------------|----------------
1049
****************************************************************************************/
1050
void get_next_bit(Bit_Obj *bitobj)
1055
if (bitobj->code_bit_count == 0)
1057
bitobj->current_word = *bitobj->code_word_ptr++;
1059
bitobj->code_bit_count = 16;
1062
bitobj->code_bit_count = sub(bitobj->code_bit_count,1);
1063
temp = shr_nocheck(bitobj->current_word,bitobj->code_bit_count);
1065
bitobj->next_bit = (Word16 )(temp & 1);
1068
/****************************************************************************************
1071
Syntax: Word16 get_rand(Rand_Obj *randobj)
1073
Description: Returns a random Word16 based on the seeds inside the rand object
1075
WMOPS: 7kHz | 24kbit | 32kbit
1076
-------|--------------|----------------
1078
-------|--------------|----------------
1080
-------|--------------|----------------
1082
14kHz | 24kbit | 32kbit | 48kbit
1083
-------|--------------|----------------|----------------
1084
AVG | 0.00 | 0.00 | 0.00
1085
-------|--------------|----------------|----------------
1086
MAX | 0.00 | 0.00 | 0.00
1087
-------|--------------|----------------|----------------
1089
****************************************************************************************/
1090
Word16 get_rand(Rand_Obj *randobj)
1095
acca = L_add(randobj->seed0,randobj->seed3);
1096
random_word = extract_l(acca);
1100
if ((random_word & 32768L) != 0)
1101
random_word = add(random_word,1);
1103
randobj->seed3 = randobj->seed2;
1105
randobj->seed2 = randobj->seed1;
1107
randobj->seed1 = randobj->seed0;
1109
randobj->seed0 = random_word;
1112
return(random_word);