コード例 #1
0
ファイル: stretch.cpp プロジェクト: fritsjanb/exacore
int main(int argc, char **argv) {
    if (argc > 1 && strcmp(argv[1], "-n") == 0) {
        cpu_force_no_simd( );
    }

    build_lookup_tables( );

    /* Read 1080p UYVY422 frames on stdin. Dump M-JPEG stream on stdout. */
    RawFrame frame(720, 480, RawFrame::CbYCrY8422);

    ssize_t ret;


    for (;;) {
        ret = frame.read_from_fd(STDIN_FILENO);

        if (ret < 0) {
            perror("frame.read_from_fd");
            exit(1);
        } else if (ret == 0) {
            break;
        } else {
            RawFrame *out = upscale(&frame);

            if (out->write_to_fd(STDOUT_FILENO) < 0) {
                perror("write_to_fd");
                break;
            }
            delete out;
        }            
    }
}
コード例 #2
0
VariantBuilderIndividualRegion::VariantBuilderIndividualRegion(const VariantHeader& header, const bool enable_validation):
    m_header { header.m_header },   // Important: don't deep copy header here, call constructor that shares ownership
    m_field_lookup_table(uint32_t(header.m_header->n[BCF_DT_ID])),   // N.B.: calling constructor that takes an int, so use () instead of {}
    m_gt_field_index { header.field_index("GT") },
    m_num_present_fields { 0 },
    m_int_fields{},
    m_float_fields{},
    m_string_fields{},
    m_enable_validation { enable_validation }
{
  const auto num_indiv_fields = header.n_individual_fields();
  m_int_fields.reserve(num_indiv_fields);
  m_float_fields.reserve(num_indiv_fields);
  m_string_fields.reserve(num_indiv_fields);
  build_lookup_tables();
}