• Home
  • Raw
  • Download

Lines Matching refs:rd

336 dump_pattern_line (const vbi3_raw_decoder * rd, unsigned int row, FILE * fp)  in dump_pattern_line()  argument
342 sp = &rd->sampling; in dump_pattern_line()
371 fprintf (fp, "%02x ", (uint8_t) rd->pattern[pos + i]); in dump_pattern_line()
378 _vbi3_raw_decoder_dump (const vbi3_raw_decoder * rd, FILE * fp) in _vbi3_raw_decoder_dump() argument
385 fprintf (fp, "vbi3_raw_decoder %p\n", rd); in _vbi3_raw_decoder_dump()
387 if (NULL == rd) in _vbi3_raw_decoder_dump()
390 fprintf (fp, " services 0x%08x\n", rd->services); in _vbi3_raw_decoder_dump()
392 for (i = 0; i < rd->n_jobs; ++i) in _vbi3_raw_decoder_dump()
394 i + 1, rd->jobs[i].id, vbi_sliced_name (rd->jobs[i].id)); in _vbi3_raw_decoder_dump()
396 if (!rd->pattern) { in _vbi3_raw_decoder_dump()
401 sp = &rd->sampling; in _vbi3_raw_decoder_dump()
406 dump_pattern_line (rd, i, fp); in _vbi3_raw_decoder_dump()
433 slice (vbi3_raw_decoder * rd, in slice() argument
437 if (rd->debug && NULL != rd->sp_lines) { in slice()
442 rd->sp_lines[i].points, in slice()
443 &rd->sp_lines[i].n_points, N_ELEMENTS (rd->sp_lines[i].points), raw); in slice()
451 decode_pattern (vbi3_raw_decoder * rd, in decode_pattern() argument
457 sp = &rd->sampling; in decode_pattern()
467 job = rd->jobs + j - 1; in decode_pattern()
469 if (!slice (rd, sliced, job, i, raw)) { in decode_pattern()
520 if (0 == rd->readjust) { in decode_pattern()
578 vbi3_raw_decoder_decode (vbi3_raw_decoder * rd, in vbi3_raw_decoder_decode() argument
590 if (!rd->services) in vbi3_raw_decoder_decode()
593 sp = &rd->sampling; in vbi3_raw_decoder_decode()
598 pattern = rd->pattern; in vbi3_raw_decoder_decode()
606 _vbi3_raw_decoder_dump (rd, stderr); in vbi3_raw_decoder_decode()
615 sliced = decode_pattern (rd, sliced, pattern, i, raw); in vbi3_raw_decoder_decode()
621 rd->readjust = (rd->readjust + 1) & 15; in vbi3_raw_decoder_decode()
634 vbi3_raw_decoder_reset (vbi3_raw_decoder * rd) in vbi3_raw_decoder_reset() argument
636 assert (NULL != rd); in vbi3_raw_decoder_reset()
638 if (rd->pattern) { in vbi3_raw_decoder_reset()
639 vbi_free (rd->pattern); in vbi3_raw_decoder_reset()
640 rd->pattern = NULL; in vbi3_raw_decoder_reset()
643 rd->services = 0; in vbi3_raw_decoder_reset()
644 rd->n_jobs = 0; in vbi3_raw_decoder_reset()
646 rd->readjust = 1; in vbi3_raw_decoder_reset()
648 CLEAR (rd->jobs); in vbi3_raw_decoder_reset()
652 remove_job_from_pattern (vbi3_raw_decoder * rd, int job_num) in remove_job_from_pattern() argument
659 pattern = rd->pattern; in remove_job_from_pattern()
660 scan_lines = rd->sampling.count[0] + rd->sampling.count[1]; in remove_job_from_pattern()
702 (vbi3_raw_decoder * rd, vbi_service_set services) { in vbi3_raw_decoder_remove_services() argument
706 assert (NULL != rd); in vbi3_raw_decoder_remove_services()
708 job = rd->jobs; in vbi3_raw_decoder_remove_services()
711 while (job_num < rd->n_jobs) { in vbi3_raw_decoder_remove_services()
713 if (rd->pattern) in vbi3_raw_decoder_remove_services()
714 remove_job_from_pattern (rd, job_num); in vbi3_raw_decoder_remove_services()
716 memmove (job, job + 1, (rd->n_jobs - job_num - 1) * sizeof (*job)); in vbi3_raw_decoder_remove_services()
718 --rd->n_jobs; in vbi3_raw_decoder_remove_services()
720 CLEAR (rd->jobs[rd->n_jobs]); in vbi3_raw_decoder_remove_services()
726 rd->services &= ~services; in vbi3_raw_decoder_remove_services()
728 return rd->services; in vbi3_raw_decoder_remove_services()
732 add_job_to_pattern (vbi3_raw_decoder * rd, in add_job_to_pattern() argument
741 scan_lines = rd->sampling.count[0] in add_job_to_pattern()
742 + rd->sampling.count[1]; in add_job_to_pattern()
744 pattern_end = rd->pattern + scan_lines * _VBI3_RAW_DECODER_MAX_WAYS; in add_job_to_pattern()
750 pattern = rd->pattern + start[field] * _VBI3_RAW_DECODER_MAX_WAYS; in add_job_to_pattern()
792 pattern = rd->pattern + start[field] * _VBI3_RAW_DECODER_MAX_WAYS; in add_job_to_pattern()
882 vbi3_raw_decoder_add_services (vbi3_raw_decoder * rd, in vbi3_raw_decoder_add_services() argument
888 assert (NULL != rd); in vbi3_raw_decoder_add_services()
892 if (rd->services & services) { in vbi3_raw_decoder_add_services()
893 info (&rd->log, in vbi3_raw_decoder_add_services()
894 "Already decoding services 0x%08x.", rd->services & services); in vbi3_raw_decoder_add_services()
895 services &= ~rd->services; in vbi3_raw_decoder_add_services()
899 info (&rd->log, "No services to add."); in vbi3_raw_decoder_add_services()
900 return rd->services; in vbi3_raw_decoder_add_services()
903 if (!rd->pattern) { in vbi3_raw_decoder_add_services()
908 scan_lines = rd->sampling.count[0] + rd->sampling.count[1]; in vbi3_raw_decoder_add_services()
911 size = scan_ways * sizeof (rd->pattern[0]); in vbi3_raw_decoder_add_services()
912 rd->pattern = (int8_t *) vbi_malloc (size); in vbi3_raw_decoder_add_services()
913 if (NULL == rd->pattern) { in vbi3_raw_decoder_add_services()
914 error (&rd->log, "Out of memory."); in vbi3_raw_decoder_add_services()
915 return rd->services; in vbi3_raw_decoder_add_services()
918 memset (rd->pattern, 0, scan_ways * sizeof (rd->pattern[0])); in vbi3_raw_decoder_add_services()
921 if (525 == rd->sampling.scanning) { in vbi3_raw_decoder_add_services()
940 job = rd->jobs; in vbi3_raw_decoder_add_services()
943 for (j = 0; j < rd->n_jobs; ++j) { in vbi3_raw_decoder_add_services()
958 error (&rd->log, in vbi3_raw_decoder_add_services()
963 } else if (j >= rd->n_jobs) { in vbi3_raw_decoder_add_services()
968 sp = &rd->sampling; in vbi3_raw_decoder_add_services()
970 if (!_vbi_sampling_par_check_services_log (sp, par->id, strict, &rd->log)) in vbi3_raw_decoder_add_services()
1019 rd->log.mask, rd->log.fn, rd->log.user_data); in vbi3_raw_decoder_add_services()
1023 if (!add_job_to_pattern (rd, job - rd->jobs, start, count)) { in vbi3_raw_decoder_add_services()
1024 error (&rd->log, in vbi3_raw_decoder_add_services()
1032 if (job >= rd->jobs + rd->n_jobs) in vbi3_raw_decoder_add_services()
1033 ++rd->n_jobs; in vbi3_raw_decoder_add_services()
1035 rd->services |= par->id; in vbi3_raw_decoder_add_services()
1038 return rd->services; in vbi3_raw_decoder_add_services()
1042 vbi3_raw_decoder_sampling_point (vbi3_raw_decoder * rd, in vbi3_raw_decoder_sampling_point() argument
1045 assert (NULL != rd); in vbi3_raw_decoder_sampling_point()
1048 if (row >= rd->n_sp_lines) in vbi3_raw_decoder_sampling_point()
1051 if (nth_bit >= rd->sp_lines[row].n_points) in vbi3_raw_decoder_sampling_point()
1054 *point = rd->sp_lines[row].points[nth_bit]; in vbi3_raw_decoder_sampling_point()
1060 vbi3_raw_decoder_debug (vbi3_raw_decoder * rd, vbi_bool enable) in vbi3_raw_decoder_debug() argument
1068 assert (NULL != rd); in vbi3_raw_decoder_debug()
1075 rd->debug = ! !enable; in vbi3_raw_decoder_debug()
1079 n_lines = rd->sampling.count[0] + rd->sampling.count[1]; in vbi3_raw_decoder_debug()
1082 switch (rd->sampling.sp_sample_format) { in vbi3_raw_decoder_debug()
1093 if (rd->n_sp_lines == n_lines) in vbi3_raw_decoder_debug()
1096 vbi_free (rd->sp_lines); in vbi3_raw_decoder_debug()
1097 rd->sp_lines = NULL; in vbi3_raw_decoder_debug()
1098 rd->n_sp_lines = 0; in vbi3_raw_decoder_debug()
1101 rd->sp_lines = calloc (n_lines, sizeof (*rd->sp_lines)); in vbi3_raw_decoder_debug()
1102 if (NULL == rd->sp_lines) in vbi3_raw_decoder_debug()
1105 rd->n_sp_lines = n_lines; in vbi3_raw_decoder_debug()
1112 vbi3_raw_decoder_services (vbi3_raw_decoder * rd) in vbi3_raw_decoder_services() argument
1114 assert (NULL != rd); in vbi3_raw_decoder_services()
1116 return rd->services; in vbi3_raw_decoder_services()
1138 (vbi3_raw_decoder * rd, const vbi_sampling_par * sp, int strict) { in vbi3_raw_decoder_set_sampling_par() argument
1141 assert (NULL != rd); in vbi3_raw_decoder_set_sampling_par()
1144 services = rd->services; in vbi3_raw_decoder_set_sampling_par()
1146 vbi3_raw_decoder_reset (rd); in vbi3_raw_decoder_set_sampling_par()
1148 if (!_vbi_sampling_par_valid_log (sp, &rd->log)) { in vbi3_raw_decoder_set_sampling_par()
1149 CLEAR (rd->sampling); in vbi3_raw_decoder_set_sampling_par()
1153 rd->sampling = *sp; in vbi3_raw_decoder_set_sampling_par()
1156 vbi3_raw_decoder_debug (rd, rd->debug); in vbi3_raw_decoder_set_sampling_par()
1158 return vbi3_raw_decoder_add_services (rd, services, strict); in vbi3_raw_decoder_set_sampling_par()
1169 (const vbi3_raw_decoder * rd, vbi_sampling_par * sp) in vbi3_raw_decoder_get_sampling_par() argument
1171 assert (NULL != rd); in vbi3_raw_decoder_get_sampling_par()
1174 *sp = rd->sampling; in vbi3_raw_decoder_get_sampling_par()
1178 vbi3_raw_decoder_set_log_fn (vbi3_raw_decoder * rd, in vbi3_raw_decoder_set_log_fn() argument
1183 assert (NULL != rd); in vbi3_raw_decoder_set_log_fn()
1188 rd->log.mask = mask; in vbi3_raw_decoder_set_log_fn()
1189 rd->log.fn = log_fn; in vbi3_raw_decoder_set_log_fn()
1190 rd->log.user_data = user_data; in vbi3_raw_decoder_set_log_fn()
1193 vbi3_bit_slicer_set_log_fn (&rd->jobs[i].slicer, mask, log_fn, user_data); in vbi3_raw_decoder_set_log_fn()
1203 _vbi3_raw_decoder_destroy (vbi3_raw_decoder * rd) in _vbi3_raw_decoder_destroy() argument
1205 vbi3_raw_decoder_reset (rd); in _vbi3_raw_decoder_destroy()
1207 vbi3_raw_decoder_debug (rd, FALSE); in _vbi3_raw_decoder_destroy()
1210 CLEAR (*rd); in _vbi3_raw_decoder_destroy()
1219 _vbi3_raw_decoder_init (vbi3_raw_decoder * rd, const vbi_sampling_par * sp) in _vbi3_raw_decoder_init() argument
1221 CLEAR (*rd); in _vbi3_raw_decoder_init()
1223 vbi3_raw_decoder_reset (rd); in _vbi3_raw_decoder_init()
1226 if (!_vbi_sampling_par_valid_log (sp, &rd->log)) in _vbi3_raw_decoder_init()
1229 rd->sampling = *sp; in _vbi3_raw_decoder_init()
1242 vbi3_raw_decoder_delete (vbi3_raw_decoder * rd) in vbi3_raw_decoder_delete() argument
1244 if (NULL == rd) in vbi3_raw_decoder_delete()
1247 _vbi3_raw_decoder_destroy (rd); in vbi3_raw_decoder_delete()
1249 vbi_free (rd); in vbi3_raw_decoder_delete()
1270 vbi3_raw_decoder *rd; in vbi3_raw_decoder_new() local
1272 rd = vbi_malloc (sizeof (*rd)); in vbi3_raw_decoder_new()
1273 if (NULL == rd) { in vbi3_raw_decoder_new()
1278 if (!_vbi3_raw_decoder_init (rd, sp)) { in vbi3_raw_decoder_new()
1279 vbi_free (rd); in vbi3_raw_decoder_new()
1280 rd = NULL; in vbi3_raw_decoder_new()
1283 return rd; in vbi3_raw_decoder_new()