project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
FFmpeg
b90912be6802dc64bcd6cd808961f9e0a0f7f6ed
1
static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) { LavfiContext *lavfi = avctx->priv_data; double min_pts = DBL_MAX; int stream_idx, min_pts_sink_idx = 0; AVFilterBufferRef *ref; AVPicture pict; int ret, i; int size = 0; /* iterate through all the graph sink...
24,240
FFmpeg
7fb92be7e50ea4ba5712804326c6814ae02dd190
1
static inline void qtrle_decode_2n4bpp(QtrleContext *s, int stream_ptr, int row_ptr, int lines_to_change, int bpp) { int rle_code, i; int pixel_ptr; int row_inc = s->frame.linesize[0]; unsigned char pi[16]; /* 16 palette indices */ unsigned char *rgb = s->frame.d...
24,241
FFmpeg
f0da370a523d76fb5f48e58537f26a9d949e9c05
1
static void display_picref(AVFilterBufferRef *picref, AVRational time_base) { int x, y; uint8_t *p0, *p; int64_t delay; if (picref->pts != AV_NOPTS_VALUE) { if (last_pts != AV_NOPTS_VALUE) { /* sleep roughly the right amount of time; * usleep is in microseconds...
24,242
qemu
d87aa138039a4be6d705793fd3e397c69c52405a
1
static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt) { int ret; int network_header_length = ppkt->ip->ip_hl * 4; trace_colo_compare_main("compare udp"); /* * Because of ppkt and spkt are both in the same connection, * The ppkt's src ip, dst ip, src port, dst port, ip_proto...
24,243
qemu
94ef4f337fb614f18b765a8e0e878a4c23cdedcd
1
void vga_mem_writeb(VGACommonState *s, hwaddr addr, uint32_t val) { int memory_map_mode, plane, write_mode, b, func_select, mask; uint32_t write_mask, bit_mask, set_mask; #ifdef DEBUG_VGA_MEM printf("vga: [0x" TARGET_FMT_plx "] = 0x%02x\n", addr, val); #endif /* convert to VGA memory offset */ ...
24,245
FFmpeg
361e0310d95bf2a0377f168518d1135ae15ca3f8
1
static int read_channel_params(MLPDecodeContext *m, unsigned int substr, GetBitContext *gbp, unsigned int ch) { SubStream *s = &m->substream[substr]; ChannelParams *cp = &s->channel_params[ch]; FilterParams *fir = &cp->filter_params[FIR]; FilterParams *iir = &cp->fil...
24,246
FFmpeg
b2c2589ecf87e6d42d4134e726552a35b2820e09
1
static int wsvqa_read_packet(AVFormatContext *s, AVPacket *pkt) { WsVqaDemuxContext *wsvqa = s->priv_data; AVIOContext *pb = s->pb; int ret = -1; unsigned char preamble[VQA_PREAMBLE_SIZE]; unsigned int chunk_type; unsigned int chunk_size; int skip_byte; ...
24,247
FFmpeg
61af627d56c785650ac3d235f6356ee3bc5676ee
0
static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index, const char *filt_name, const char *args, void *log_ctx) { AVFilter *filt; char inst_name[30]; char tmp_args[256]; int ret; snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%d", filt...
24,248
FFmpeg
224944895efe6ac23e3b8f9d35abfee9f5c6c440
0
static void flush_packet(AVFormatContext *ctx, int stream_index, int64_t pts, int64_t dts, int64_t scr) { MpegMuxContext *s = ctx->priv_data; StreamInfo *stream = ctx->streams[stream_index]->priv_data; uint8_t *buf_ptr; int size, payload_size, startcode, id, stuffing_size...
24,249
FFmpeg
dcc39ee10e82833ce24aa57926c00ffeb1948198
0
void ff_xvmc_init_block(MpegEncContext *s) { struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f->data[2]; assert(render && render->xvmc_id == AV_XVMC_ID); s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); }
24,250
FFmpeg
0d21a84605bad4e75dacb8196e5859902ed36f01
0
static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my) { const int xy= s->mb_x + 1 + (s->mb_y + 1)*(s->mb_width + 2); s->p_mv_table[xy][0] = mx; s->p_mv_table[xy][1] = my; /* has allready been set to the 4 MV if 4MV is done */ if(!(s->flags&CODEC_FLAG_4MV)){ in...
24,252
FFmpeg
9f61abc8111c7c43f49ca012e957a108b9cc7610
0
static int hds_flush(AVFormatContext *s, OutputStream *os, int final, int64_t end_ts) { HDSContext *c = s->priv_data; int i, ret = 0; char target_filename[1024]; int index = s->streams[os->first_stream]->id; if (!os->packets_written) return 0; avio_flush...
24,253
qemu
52e38eb0512585a5fadb431a65997b602d44874b
1
build_dsdt(GArray *table_data, GArray *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, PcPciInfo *pci, MachineState *machine) { CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; GPtrArray *mem_ranges = g_ptr_array_new_with_free_func(crs_range_free...
24,254
FFmpeg
74853ed3f845212f4092e7b7e89dc2262926f4f5
1
static void init_input_filter(FilterGraph *fg, AVFilterInOut *in) { InputStream *ist; enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx); int i; // TODO: support other filter types if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) { av...
24,255
FFmpeg
7f526efd17973ec6d2204f7a47b6923e2be31363
1
static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, int width) { #ifdef HAVE_MMX asm volatile( "movq "MANGLE(bm01010101)", %%mm2\n\t" "mov %0, %%"REG_a" \n\t" "1: \n\t" "movq (%1, %%"REG_a",2), %%mm0 \n\t" "movq 8(%1, %%"REG_a",2), %%mm1 \n\t" "pand %%mm2, %%mm0 \n\t" "pand %%mm...
24,256
qemu
d65aaf3773e4be7ae97df9d867cbe9b36e2fb8a1
1
static void print_pte(Monitor *mon, uint32_t addr, uint32_t pte, uint32_t mask) { monitor_printf(mon, "%08x: %08x %c%c%c%c%c%c%c%c\n", addr, pte & mask, pte & PG_GLOBAL_MASK ? 'G' : '-', pte & PG_PSE_MASK ? 'P' : '-', ...
24,257
FFmpeg
a1684cf82d1aa35de0ae97724477501f92395c2b
1
av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) { static int init_done=0; int i; common_init(s); if(s->msmpeg4_version>=4){ s->min_qcoeff= -255; s->max_qcoeff= 255; } if (!init_done) { /* init various encoding tables */ init_done = 1; ...
24,258
FFmpeg
5f928c5201c077b9765610bc5304235c3f1d9bd6
1
av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size) { /* cast to avoid compiler warning */ ff_init_range_encoder(c, (uint8_t *)buf, buf_size); c->low = AV_RB16(c->bytestream); c->bytestream += 2;
24,259
qemu
7d1b0095bff7157e856d1d0e6c4295641ced2752
1
static void gen_load_exclusive(DisasContext *s, int rt, int rt2, TCGv addr, int size) { TCGv tmp; switch (size) { case 0: tmp = gen_ld8u(addr, IS_USER(s)); break; case 1: tmp = gen_ld16u(addr, IS_USER(s)); break; case 2: ...
24,260
FFmpeg
8aba7968dd604aae91ee42cbce0be3dad7dceb30
1
static int vcr1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VCR1Context *const a = avctx->priv_data; AVFrame *const p = data; con...
24,261
qemu
1fd959466574c3d46f4898f2e27cd3b1060338e4
1
static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, const int *const_args) { int c; switch (opc) { case INDEX_op_exit_tb: tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_I0, args[0]); tcg_out32(s, JMPL | INSN_RD(TCG_REG_G0) | INSN_RS1(...
24,262
FFmpeg
4cc2a357f5dce9bad36b59fb31ba5cf61cc56272
1
static void sbr_hf_inverse_filter(SBRDSPContext *dsp, int (*alpha0)[2], int (*alpha1)[2], const int X_low[32][40][2], int k0) { int k; int shift, round; for (k = 0; k < k0; k++) { SoftFloat phi[3][2][2]; SoftFloat ...
24,263
qemu
4a41a2d68a684241aca96dba066e0699941b730d
1
void nbd_client_session_close(NbdClientSession *client) { if (!client->bs) { return; } nbd_teardown_connection(client); client->bs = NULL; }
24,264
qemu
fff39a7ad09da07ef490de05c92c91f22f8002f2
1
static void v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name)...
24,265
FFmpeg
9f61abc8111c7c43f49ca012e957a108b9cc7610
0
static int open_in(HLSContext *c, AVIOContext **in, const char *url) { AVDictionary *tmp = NULL; int ret; av_dict_copy(&tmp, c->avio_opts, 0); ret = avio_open2(in, url, AVIO_FLAG_READ, c->interrupt_callback, &tmp); av_dict_free(&tmp); return ret; }
24,266
FFmpeg
af165acefacd89196c003c24802fa3c494d54d3a
0
static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "trak"); mov_write_tkhd_tag(pb, track, st); if (supports_edts(mov)) mov_write_e...
24,267
FFmpeg
4bb1070c154e49d35805fbcdac9c9e92f702ef96
0
static int write_extradata(FFV1Context *f) { RangeCoder *const c = &f->c; uint8_t state[CONTEXT_SIZE]; int i, j, k; uint8_t state2[32][CONTEXT_SIZE]; unsigned v; memset(state2, 128, sizeof(state2)); memset(state, 128, sizeof(state)); f->avctx->extradata_size = 10000 + 4 + ...
24,268
FFmpeg
499c2d41d75fdadbf65daa9eaf743f61632f14f8
0
static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){ int hours, minutes, seconds; if(!show_bits(gb, 18)){ av_log(s->avctx, AV_LOG_WARNING, "GOP header invalid\n"); return -1; } hours= get_bits(gb, 5); minutes= get_bits(gb, 6); skip_bits1(gb); ...
24,270
FFmpeg
073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1
1
static void init_vlcs(ASV1Context *a){ static int done = 0; if (!done) { done = 1; init_vlc(&ccp_vlc, VLC_BITS, 17, &ccp_tab[0][1], 2, 1, &ccp_tab[0][0], 2, 1); init_vlc(&dc_ccp_vlc, VLC_BITS, 8, &dc_ccp_tab[0][1], 2, 1, ...
24,271
FFmpeg
1ca87d600bc069fe4cf497c410b4f794e88a122d
1
static int applehttp_close(URLContext *h) { AppleHTTPContext *s = h->priv_data; free_segment_list(s); free_variant_list(s); ffurl_close(s->seg_hd); av_free(s); return 0; }
24,272
FFmpeg
55d05286696473487ce51e347985378e28c0713b
1
int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt) { int i; double scale = 0; if (s->dither.method > SWR_DITHER_TRIANGULAR_HIGHPASS && s->dither.method <= SWR_DITHER_NS) return AVERROR(EINVAL); out_fmt = av_get_packed_sample_fmt(out_fmt); ...
24,273
qemu
6e72719e721a40fe1224701ca10edc1caf0cd708
1
int qemu_pixman_get_type(int rshift, int gshift, int bshift) { int type = PIXMAN_TYPE_OTHER; if (rshift > gshift && gshift > bshift) { if (bshift == 0) { type = PIXMAN_TYPE_ARGB; } else { type = PIXMAN_TYPE_RGBA; } } else if (rshift < gshift && gs...
24,274
qemu
f8ed85ac992c48814d916d5df4d44f9a971c5de4
1
static int prom_init1(SysBusDevice *dev) { PROMState *s = OPENPROM(dev); memory_region_init_ram(&s->prom, OBJECT(s), "sun4m.prom", PROM_SIZE_MAX, &error_abort); vmstate_register_ram_global(&s->prom); memory_region_set_readonly(&s->prom, true); sysbus_init_mmio(dev...
24,275
qemu
488661ee9dd300110a6612d52fe68e2bb3539a5f
1
void helper_lswx(CPUPPCState *env, target_ulong addr, uint32_t reg, uint32_t ra, uint32_t rb) { if (likely(xer_bc != 0)) { if (unlikely((ra != 0 && reg < ra && (reg + xer_bc) > ra) || (reg < rb && (reg + xer_bc) > rb))) { helper_raise_exception_err(env...
24,276
FFmpeg
dd561441b1e849df7d8681c6f32af82d4088dafd
0
static void h264_v_loop_filter_luma_intra_c(uint8_t *pix, int stride, int alpha, int beta) { h264_loop_filter_luma_intra_c(pix, stride, 1, alpha, beta); }
24,277
qemu
f8ed85ac992c48814d916d5df4d44f9a971c5de4
1
mips_mipssim_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; ...
24,278
qemu
794cbc26eb94ce13c75d105eea9ff0afff56e2c2
1
SDState *sd_init(BlockDriverState *bs, bool is_spi) { SDState *sd; if (bdrv_is_read_only(bs)) { fprintf(stderr, "sd_init: Cannot use read-only drive\n"); return NULL; } sd = (SDState *) g_malloc0(sizeof(SDState)); sd->buf = qemu_blockalign(bs, 512); sd->spi = is_spi;...
24,279
qemu
546a7dc40e8b8b6440a052e2b5cdfe9aadcaccf6
1
static coroutine_fn int qcow2_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BDRVQcow2State *s = bs->opaque; int offset_in_cluster, n1; int ret; unsigned int cur_byte...
24,281
qemu
9745807191a81c45970f780166f44a7f93b18653
1
static void gen_div(DisasContext *dc, TCGv dest, TCGv srca, TCGv srcb) { TCGv sr_ov = tcg_temp_new(); TCGv t0 = tcg_temp_new(); tcg_gen_setcondi_tl(TCG_COND_EQ, sr_ov, srcb, 0); /* The result of divide-by-zero is undefined. Supress the host-side exception by dividing by 1. */ tcg_ge...
24,282
FFmpeg
3faa303a47e0c3b59a53988e0f76018930c6cb1a
0
static inline void decode_subblock3(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q_dc, int q_ac1, int q_ac2) { int coeffs[4]; coeffs[0] = modulo_three_table[code][0]; coeffs[1] = modulo_three_table[code][1]; coeffs[2] = modulo_...
24,284
FFmpeg
87e8788680e16c51f6048af26f3f7830c35207a5
0
static int mm_probe(AVProbeData *p) { /* the first chunk is always the header */ if (p->buf_size < MM_PREAMBLE_SIZE) return 0; if (AV_RL16(&p->buf[0]) != MM_TYPE_HEADER) return 0; if (AV_RL32(&p->buf[2]) != MM_HEADER_LEN_V && AV_RL32(&p->buf[2]) != MM_HEADER_LEN_AV) retur...
24,286
FFmpeg
403ee835e7913eb9536b22c2b22edfdd700166a9
0
static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st) { RTSPState *rt = s->priv_data; AVFormatContext *rtpctx = rtsp_st->transport_priv; uint8_t *buf, *ptr; int size; uint8_t *interleave_header, *interleaved_packet; size = avio_close_dyn_buf(rtpctx->pb, &buf); ptr = ...
24,287
FFmpeg
b19e3983cfb157751301aec87237ea28676665f0
0
static int find_and_decode_index(NUTContext *nut){ AVFormatContext *s= nut->avf; ByteIOContext *bc = s->pb; uint64_t tmp, end; int i, j, syncpoint_count; int64_t filesize= url_fsize(bc); int64_t *syncpoints; int8_t *has_keyframe; url_fseek(bc, filesize-12, SEEK_SET); url_f...
24,288
qemu
25ba3a681213390e9212dbc987d61843c3b41d5b
1
static int dump_ppc_insns (CPUPPCState *env) { opc_handler_t **table, *handler; uint8_t opc1, opc2, opc3; printf("Instructions set:\n"); /* opc1 is 6 bits long */ for (opc1 = 0x00; opc1 < 0x40; opc1++) { table = env->opcodes; handler = table[opc1]; if (is_indirect_...
24,293
FFmpeg
1509c018bd5b054a2354e20021ccbac9c934d213
1
static int get_packet_size(const uint8_t *buf, int size) { int score, fec_score, dvhs_score; if (size < (TS_FEC_PACKET_SIZE * 5 + 1)) return AVERROR_INVALIDDATA; score = analyze(buf, size, TS_PACKET_SIZE, NULL); dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL); fec_...
24,295
FFmpeg
faaec4676cb4c7a2303d50df66c6290bc96a7657
1
static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) { EbmlList *seekhead_list = &matroska->seekhead; MatroskaSeekhead *seekhead = seekhead_list->elem; int64_t before_pos = avio_tell(matroska->ctx->pb); int i; // we should not do any seeking in the streaming case if (!m...
24,296
qemu
cd0c6f473532bfaf20a095bc90a18e45162981b5
1
static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr, target_ulong msrm, int keep_msrh) { CPUState *cs = CPU(ppc_env_get_cpu(env)); #if defined(TARGET_PPC64) if (msr_is_64bit(env, msr)) { nip = (uint64_t)nip; msr &= (uint64_t)msrm; } else {...
24,297
qemu
a808c0865b720e22ca2929ec3d362d4610fbad51
1
static void mmio_interface_realize(DeviceState *dev, Error **errp) { MMIOInterface *s = MMIO_INTERFACE(dev); DPRINTF("realize from 0x%" PRIX64 " to 0x%" PRIX64 " map host pointer" " %p\n", s->start, s->end, s->host_ptr); if (!s->host_ptr) { error_setg(errp, "host_ptr property m...
24,298
FFmpeg
61cd19b8bc32185c8caf64d89d1b0909877a0707
1
static void load_cursor(VmncContext *c, const uint8_t *src) { int i, j, p; const int bpp = c->bpp2; uint8_t *dst8 = c->curbits; uint16_t *dst16 = (uint16_t *)c->curbits; uint32_t *dst32 = (uint32_t *)c->curbits; for (j = 0; j < c->cur_h; j++) { for (i = 0; i < c...
24,299
qemu
b946a1533209f61a93e34898aebb5b43154b99c3
1
PCIDevice *pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn) { PCINE2000State *d; NE2000State *s; uint8_t *pci_conf; d = (PCINE2000State *)pci_register_device(bus, "NE2000", sizeof(PCINE2000State), de...
24,300
FFmpeg
28f9ab7029bd1a02f659995919f899f84ee7361b
0
av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) { int i, j; ff_check_alignment(); #if CONFIG_ENCODERS if (avctx->bits_per_raw_sample == 10) { c->fdct = ff_jpeg_fdct_islow_10; c->fdct248 = ff_fdct248_islow_10; } else { if(avctx->dct_algo==FF_DCT_...
24,301
FFmpeg
d24e08e978792e09d212018677d1c0b8208ecef8
0
static int dash_flush(AVFormatContext *s, int final, int stream) { DASHContext *c = s->priv_data; int i, ret = 0; const char *proto = avio_find_protocol_name(s->filename); int use_rename = proto && !strcmp(proto, "file"); int cur_flush_segment_index = 0; if (stream >= 0) cur_...
24,302
qemu
9e6636c72d8d6f0605e23ed820c8487686882b12
0
static int stream_set_speed(BlockJob *job, int64_t value) { StreamBlockJob *s = container_of(job, StreamBlockJob, common); if (value < 0) { return -EINVAL; } ratelimit_set_speed(&s->limit, value / BDRV_SECTOR_SIZE); return 0; }
24,303
qemu
1dcea8e82b1d7795e6719a8ac8762993fc1ed4b3
0
static void cirrus_update_memory_access(CirrusVGAState *s) { unsigned mode; if ((s->sr[0x17] & 0x44) == 0x44) { goto generic_io; } else if (s->cirrus_srcptr != s->cirrus_srcptr_end) { goto generic_io; } else { if ((s->gr[0x0B] & 0x14) == 0x14) { goto generic_io; ...
24,304
FFmpeg
e45a2872fafe631c14aee9f79d0963d68c4fc1fd
0
void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h) { POWERPC_TBL_DECLARE(altivec_put_pixels16_xy2_num, 1); #ifdef ALTIVEC_USE_REFERENCE_C_CODE int j; POWERPC_TBL_START_COUNT(altivec_put_pixels16_xy2_num, 1); for (j = 0; j < 4; j++) { int i; const u...
24,305
qemu
a89f364ae8740dfc31b321eed9ee454e996dc3c1
0
static void omap_lpg_update(struct omap_lpg_s *s) { int64_t on, period = 1, ticks = 1000; static const int per[8] = { 1, 2, 4, 8, 12, 16, 20, 24 }; if (~s->control & (1 << 6)) /* LPGRES */ on = 0; else if (s->control & (1 << 7)) /* PERM_ON */ on = period; else { ...
24,306
qemu
ef76dc59fa5203d146a2acf85a0ad5a5971a4824
0
START_TEST(vararg_number) { QObject *obj; QInt *qint; QFloat *qfloat; int value = 0x2342; int64_t value64 = 0x2342342343LL; double valuef = 2.323423423; obj = qobject_from_jsonf("%d", value); fail_unless(obj != NULL); fail_unless(qobject_type(obj) == QTYPE_QINT); q...
24,307
qemu
a0fa2cb8ccf0b73cfd3ac01d557401a2303c0de4
0
static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run, uint16_t ipbh0) { CPUS390XState *env = &cpu->env; uint32_t sccb; uint64_t code; int r = 0; cpu_synchronize_state(CPU(cpu)); if (env->psw.mask & PSW_MASK_PSTATE) { enter_pgmchec...
24,310
qemu
4534ff5426afeeae5238ba10a696cafa9a0168ee
0
static int qcow2_check(BlockDriverState *bs, BdrvCheckResult *result) { return qcow2_check_refcounts(bs, result); }
24,313
qemu
56943e8cc14b7eeeab67d1942fa5d8bcafe3e53f
0
static void qemu_tcg_init_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; static QemuCond *tcg_halt_cond; static QemuThread *tcg_cpu_thread; tcg_cpu_address_space_init(cpu, cpu->as); /* share a single thread for all cpus with TCG */ if (!tcg_cpu_thread) { cpu->...
24,314
FFmpeg
570745cc5114ea13d0054f73776533f5e6e538f8
0
AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title) { AVChapter *chapter = NULL; int i; for(i=0; i<s->nb_chapters; i++) if(s->chapters[i]->id == id) chapter = s->chapters[i]; if(!chapter){ chap...
24,316
qemu
61007b316cd71ee7333ff7a0a749a8949527575f
0
int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf, int bytes) { QEMUIOVector qiov; struct iovec iov = { .iov_base = (void *)buf, .iov_len = bytes, }; int ret; if (bytes < 0) { return -EINVAL; } qemu_iovec_init_external(&qiov, &iov, 1); ...
24,317
qemu
90f12d735d66ac1196d9a2bced039a432eefc03d
0
static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel) { const char *rn = "invalid"; if (sel != 0) check_insn(ctx, ISA_MIPS64); if (use_icount) gen_io_start(); switch (reg) { case 0: switch (sel) { case 0: gen_helper_mtc0_ind...
24,319
qemu
5039d6e23586fe6bbedc5e4fe302b48a66890ade
0
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state, bool create_fdctrl, bool no_vmport, uint32 hpet_irqs) { int i; DriveInfo *fd[MAX_FD]; DeviceState *hpet = NULL; ...
24,321
qemu
24897a767bd778fc6a050537d024565f9272cd06
0
static int qemu_gluster_parseuri(GlusterConf *gconf, const char *filename) { URI *uri; QueryParams *qp = NULL; bool is_unix = false; int ret = 0; uri = uri_parse(filename); if (!uri) { return -EINVAL; } /* transport */ if (!strcmp(uri->scheme, "gluster")) { ...
24,322
qemu
a89f364ae8740dfc31b321eed9ee454e996dc3c1
0
static void omap_prcm_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_prcm_s *s = (struct omap_prcm_s *) opaque; if (size != 4) { omap_badwidth_write32(opaque, addr, value); return; } switch (addr) { case 0x000: /...
24,323
qemu
c3a3a7d356c4df2fe145037172ae52cba5f545a5
0
int kvm_arch_init(KVMState *s, int smp_cpus) { int ret; struct utsname utsname; uname(&utsname); lm_capable_kernel = strcmp(utsname.machine, "x86_64") == 0; /* create vm86 tss. KVM uses vm86 mode to emulate 16-bit code * directly. In order to use vm86 mode, a TSS is needed. Sinc...
24,324
qemu
5379229a2708df3a1506113315214c3ce5325859
0
static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) { BOOTPClient *bc = NULL; struct mbuf *m; struct bootp_t *rbp; struct sockaddr_in saddr, daddr; struct in_addr preq_addr; int dhcp_msg_type, val; uint8_t *q; uint8_t client_ethaddr[ETH_ALEN]; /* extract exact...
24,325
qemu
daa76aa416b1e18ab1fac650ff53d966d8f21f68
1
static void hmp_logfile(Monitor *mon, const QDict *qdict) { qemu_set_log_filename(qdict_get_str(qdict, "filename")); }
24,327
qemu
b20909195745c34a819aed14ae996b60ab0f591f
1
iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data, void *private_data) { IscsiAIOCB *acb = (IscsiAIOCB *)private_data; scsi_free_scsi_task(acb->task); acb->task = NULL; }
24,329
qemu
88be7b4be4aa17c88247e162bdd7577ea79db94f
1
int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs, Error **err) { int ret = 0; BlockDriverState *bs; BdrvNextIterator *it = NULL; QEMUSnapshotInfo sn1, *snapshot = &sn1; while (ret == 0 && (it = bdrv_next(it, &bs))) { AioCon...
24,330
FFmpeg
4791a910c0dc3dd5861d38202457c9fb9bf1154c
0
int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, int length, AVCodecContext *avctx, int is_nalff, int nal_length_size) { int consumed, ret = 0; pkt->nb_nals = 0; while (length >= 4) { HEVCNAL *nal; int extract_length = 0; ...
24,332
qemu
1ee24514aed34760fb2863d98bea3a1b705d9c9f
1
static int nvme_start_ctrl(NvmeCtrl *n) { uint32_t page_bits = NVME_CC_MPS(n->bar.cc) + 12; uint32_t page_size = 1 << page_bits; if (n->cq[0] || n->sq[0] || !n->bar.asq || !n->bar.acq || n->bar.asq & (page_size - 1) || n->bar.acq & (page_size - 1) || NVME_CC_MPS(n->bar.cc) < ...
24,333
FFmpeg
0c46e958d1fd3817b8e9fa048d0450d509c80378
1
static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv) { static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b}; MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; int64_t end = avio_tell(pb...
24,335
qemu
baf35cb90204d75404892aa4e52628ae7a00669b
1
void qemu_aio_wait_end(void) { }
24,337
FFmpeg
e4e02a7d4726e9370127741eb2873d6671d3f0c3
1
void avfilter_register_all(void) { static int initialized; if (initialized) return; initialized = 1; REGISTER_FILTER (ACONVERT, aconvert, af); REGISTER_FILTER (AFIFO, afifo, af); REGISTER_FILTER (AFORMAT, aformat, af); REGISTER_FILTER (AMERGE, ...
24,338
FFmpeg
29ba091136a5e04574f7bfc1b17536c923958f6f
0
void show_banner(void) { fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d the FFmpeg developers\n", program_name, program_birth_year, this_year); fprintf(stderr, " built on %s %s with %s %s\n", __DATE__, __TIME__, CC_TYPE, CC_VERSION); fprintf(stderr, " con...
24,341
FFmpeg
82dd7d0dec29ee59af91ce18c29eb151b363ff37
0
static int decode_delta_block (bit_buffer_t *bitbuf, uint8_t *current, uint8_t *previous, int pitch, svq1_pmv_t *motion, int x, int y) { uint32_t bit_cache; uint32_t block_type; int result = 0; /* get block type */ bit_cache = get_bit_cache (bitbuf); bit_cache >>= (32 - 3); block_typ...
24,342
qemu
45fe15c25a5c9feea6e0f78434f5e9f632de9d94
1
static int pci_ich9_uninit(PCIDevice *dev) { struct AHCIPCIState *d; d = DO_UPCAST(struct AHCIPCIState, card, dev); if (msi_enabled(dev)) { msi_uninit(dev); } qemu_unregister_reset(ahci_reset, d); ahci_uninit(&d->ahci); return 0; }
24,343
FFmpeg
e45a2872fafe631c14aee9f79d0963d68c4fc1fd
0
void powerpc_display_perf_report(void) { int i; #ifndef POWERPC_PERF_USE_PMC fprintf(stderr, "PowerPC performance report\n Values are from the Time Base register, and represent 4 bus cycles.\n"); #else /* POWERPC_PERF_USE_PMC */ fprintf(stderr, "PowerPC performance report\n Values are from the PMC registers...
24,344
qemu
62a2554ec2630896d1299e1a282a64c7f3b00da0
1
void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb) { /* * We don't support MIDA (an optional facility) yet and we * catch this earlier. Just for expressing the precondition. */ g_assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW)); cds->flags = (orb->ctrl0 & ORB_CTRL0_MASK_I2...
24,345
FFmpeg
7d78a964413a50409b1db441d966cd2810eb6c86
1
static int msrle_decode_pal4(AVCodecContext *avctx, AVPicture *pic, const uint8_t *data, int data_size) { int stream_ptr = 0; unsigned char rle_code; unsigned char extra_byte, odd_pixel; unsigned char stream_byte; int pixel_ptr = 0; int row_dec = pic->linesi...
24,346
qemu
5a693efda84d7df5136cc2bd31c959bb1530b0c9
1
static int vnc_update_client(VncState *vs, int has_dirty, bool sync) { vs->has_dirty += has_dirty; if (vs->need_update && vs->ioc != NULL) { VncDisplay *vd = vs->vd; VncJob *job; int y; int height, width; int n = 0; if (vs->output.offset && !vs->audio_c...
24,347
FFmpeg
bde6f6eadc24b372c12da2894f2ee0b86b5ff6a3
1
static void vc1_mc_4mv_chroma4(VC1Context *v) { MpegEncContext *s = &v->s; DSPContext *dsp = &v->s.dsp; uint8_t *srcU, *srcV; int uvsrc_x, uvsrc_y; int uvmx_field[4], uvmy_field[4]; int i, off, tx, ty; int fieldmv = v->blk_mv_type[s->block_index[0]]; static const int s_rndtblfie...
24,348
qemu
0bd8246bfec1dfb2eb959f52db535572c0260f4c
1
static void vga_invalidate_display(void *opaque) { VGAState *s = (VGAState *)opaque; s->last_width = -1; s->last_height = -1; }
24,349
qemu
c9262e8a84a29f22fbb5edde5d17f4f6166d5ae1
1
static void virtio_setup(uint64_t dev_info) { struct schib schib; int ssid; bool found = false; uint16_t dev_no; /* * We unconditionally enable mss support. In every sane configuration, * this will succeed; and even if it doesn't, stsch_err() can deal * with the consequence...
24,350
qemu
cc2a90432d9cb7546a2c4360ad7200a2fb3af31a
1
static void qemu_cleanup_net_client(NetClientState *nc) { QTAILQ_REMOVE(&net_clients, nc, next); nc->info->cleanup(nc); }
24,352
qemu
828808f5ece20fd606218e000139799921c89d93
1
static void tcg_out_op (TCGContext *s, int opc, const TCGArg *args, const int *const_args) { int c; switch (opc) { case INDEX_op_exit_tb: tcg_out_movi (s, TCG_TYPE_I64, TCG_REG_R3, args[0]); tcg_out_b (s, 0, (tcg_target_long) tb_ret_addr); break; ...
24,353
qemu
f8762027a33e2f5d0915c56a904962b1481f75c1
1
static int socket_accept(int sock) { struct sockaddr_un addr; socklen_t addrlen; int ret; addrlen = sizeof(addr); do { ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR); g_assert_no_errno(ret); close(sock); return ret...
24,354
qemu
258133bda9a6f22ba436ef9b63b7c086cc80190b
1
ivshmem_server_handle_new_conn(IvshmemServer *server) { IvshmemServerPeer *peer, *other_peer; struct sockaddr_un unaddr; socklen_t unaddr_len; int newfd; unsigned i; /* accept the incoming connection */ unaddr_len = sizeof(unaddr); newfd = qemu_accept(server->sock_fd, ...
24,355
FFmpeg
68f593b48433842f3407586679fe07f3e5199ab9
0
static int mjpegb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, UINT8 *buf, int buf_size) { MJpegDecodeContext *s = avctx->priv_data; UINT8 *buf_end, *buf_ptr; int i; AVPicture *picture = data; GetBitContext hgb; ...
24,357
FFmpeg
d1923d15a3544cbb94563a59e7169291db76b312
1
static int idcin_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { IdcinDemuxContext *idcin = s->priv_data; if (idcin->first_pkt_pos > 0) { int ret = avio_seek(s->pb, idcin->first_pkt_pos, SEEK_SET); if (ret < 0) retur...
24,358
qemu
77be4366baface6613cfc312ba281f8e5860997c
1
static int multiwrite_req_compare(const void *a, const void *b) { return (((BlockRequest*) a)->sector - ((BlockRequest*) b)->sector); }
24,359
FFmpeg
1189af429211ac650aac730368a6cf5b23756605
1
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp) { AVFrame *src = srcp->f; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format); int i; int ret = av_frame_ref(dst, src); if (ret < 0) return ret; av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_s...
24,360
FFmpeg
45fa03b1f9b0475df666f7592f250c37763b7d64
1
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; ...
24,361
qemu
f8ed85ac992c48814d916d5df4d44f9a971c5de4
1
static void a15_daughterboard_init(const VexpressMachineState *vms, ram_addr_t ram_size, const char *cpu_model, qemu_irq *pic) { MemoryRegion *sysmem = get_system_memory(); MemoryRegion *ram = g_new(Me...
24,362
qemu
3604a76fea6ff37738d4a8f596be38407be74a83
1
static void dec_sl(DisasContext *dc) { if (dc->format == OP_FMT_RI) { LOG_DIS("sli r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm5); } else { LOG_DIS("sl r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); } if (!(dc->env->features & LM32_FEATURE_SHIFT)) { cpu_abort(dc->env, "hardware...
24,363
qemu
e1cf5582644ef63528993fb2b88dd3b43b9914c6
1
void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint) { qiov->iov = g_malloc(alloc_hint * sizeof(struct iovec)); qiov->niov = 0; qiov->nalloc = alloc_hint; qiov->size = 0; }
24,365
FFmpeg
247d30a7dba6684ccce4508424f35fd58465e535
1
static int vp3_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { Vp3DecodeContext *s = dst->priv_data, *s1 = src->priv_data; int qps_changed = 0, i, err; #define copy_fields(to, from, start_field, end_field) memcpy(&to->start_field, &from->start_field, (char*)&to->end_field - (char*)...
24,366
qemu
231bb267644ee3a9ebfd9c7f42d5d41610194b45
1
static int write_reftable_entry(BlockDriverState *bs, int rt_index) { BDRVQcowState *s = bs->opaque; uint64_t buf[RT_ENTRIES_PER_SECTOR]; int rt_start_index; int i, ret; rt_start_index = rt_index & ~(RT_ENTRIES_PER_SECTOR - 1); for (i = 0; i < RT_ENTRIES_PER_SECTOR; i++) { buf[...
24,367