project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 593831de5dce5f5b9ce1226e0d8353eecb1176e4 | 1 | int qdev_unplug(DeviceState *dev)
{
if (!dev->parent_bus->allow_hotplug) {
qemu_error("Bus %s does not support hotplugging\n",
dev->parent_bus->name);
return -1;
}
return dev->info->unplug(dev);
} | 26,503 |
FFmpeg | 8e28e0721c61cface6496fe4657ff5d3c3d2e6b8 | 0 | static int aa_read_header(AVFormatContext *s)
{
int i, j, idx, largest_idx = -1;
uint32_t nkey, nval, toc_size, npairs, header_seed, start;
char key[128], val[128], codec_name[64] = {0};
uint8_t output[24], dst[8], src[8];
int64_t largest_size = -1, current_size = -1;
struct toc_entry {
... | 26,504 |
FFmpeg | 98422c44cf86de6da8f73a7bd80284ed165c5a98 | 1 | vorbis_comment(AVFormatContext * as, uint8_t *buf, int size)
{
const uint8_t *p = buf;
const uint8_t *end = buf + size;
unsigned s, n, j;
if (size < 8) /* must have vendor_length and user_comment_list_length */
return -1;
s = bytestream_get_le32(&p);
if (end - p < s)
... | 26,505 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static float get_band_cost_ESC_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
... | 26,506 |
FFmpeg | 5a571d324129ce367584ad9d92aae1d286f389a2 | 1 | static PayloadContext *h264_new_context(void)
{
PayloadContext *data =
av_mallocz(sizeof(PayloadContext) +
FF_INPUT_BUFFER_PADDING_SIZE);
if (data) {
data->cookie = MAGIC_COOKIE;
}
return data;
}
| 26,507 |
qemu | 3a03bfa5a219fe06779706315f2555622b51193c | 1 | int qemu_pipe(int pipefd[2])
{
int ret;
#ifdef CONFIG_PIPE2
ret = pipe2(pipefd, O_CLOEXEC);
#else
ret = pipe(pipefd);
if (ret == 0) {
qemu_set_cloexec(pipefd[0]);
qemu_set_cloexec(pipefd[1]);
}
#endif
return ret;
}
| 26,508 |
FFmpeg | 8fa0ae060b759d00c8d8f4070b36c16b3dbf0d8a | 1 | static inline int parse_nal_units(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
H264Context *h = s->priv_data;
const uint8_t *buf_end = buf + buf_size;
unsigned int pps_id;
unsigned int slice... | 26,510 |
qemu | bbc5842211cdd90103cfe52f2ca24afac880694f | 1 | static inline void write_IRQreg (openpic_t *opp, int n_IRQ,
uint32_t reg, uint32_t val)
{
uint32_t tmp;
switch (reg) {
case IRQ_IPVP:
/* NOTE: not fully accurate for special IRQs, but simple and
sufficient */
/* ACTIVITY bit is read-only ... | 26,511 |
FFmpeg | 1d16a1cf99488f16492b1bb48e023f4da8377e07 | 0 | static void ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
int i;
for(i=0; i<16; i+=2)
if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ])
ff_x264_add8x4_idct_sse2 (dst + block_offset[i], block + i*16, stride);
}
| 26,513 |
qemu | f45cb2f43f5bb0a4122a64e61c746048b59a84ed | 1 | static void sync_c0_tcstatus(CPUMIPSState *cpu, int tc,
target_ulong v)
{
uint32_t status;
uint32_t tcu, tmx, tasid, tksu;
uint32_t mask = ((1 << CP0St_CU3)
| (1 << CP0St_CU2)
| (1 << CP0St_CU1)
| (1 <<... | 26,514 |
FFmpeg | 76ba09d18245a2a41dc5f93a60fd00cdf358cb1f | 1 | static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
int a = 2 << s->sprite_warping_accuracy;
int rho = 3 - s->sprite_warping_accuracy;
int r = 16 / a;
int alpha = 0;
int beta = 0;
int w = s->width;
int h = ... | 26,515 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static void gen_add16(TCGv t0, TCGv t1)
{
TCGv tmp = new_tmp();
tcg_gen_xor_i32(tmp, t0, t1);
tcg_gen_andi_i32(tmp, tmp, 0x8000);
tcg_gen_andi_i32(t0, t0, ~0x8000);
tcg_gen_andi_i32(t1, t1, ~0x8000);
tcg_gen_add_i32(t0, t0, t1);
tcg_gen_xor_i32(t0, t0, tmp);
dead_tmp(tmp);
... | 26,517 |
qemu | d3392718e1fcf0859fb7c0774a8e946bacb8419c | 1 | static void do_v7m_exception_exit(ARMCPU *cpu)
{
CPUARMState *env = &cpu->env;
CPUState *cs = CPU(cpu);
uint32_t excret;
uint32_t xpsr;
bool ufault = false;
bool sfault = false;
bool return_to_sp_process;
bool return_to_handler;
bool rettobase = false;
bool exc_secure ... | 26,518 |
FFmpeg | 41003da94a59cd014d05b3dd1d33a5f9ecf3ccda | 1 | static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
{
int (*filter_frame)(AVFilterLink *, AVFrame *);
AVFilterContext *dstctx = link->dst;
AVFilterPad *dst = link->dstpad;
AVFrame *out;
int ret;
AVFilterCommand *cmd= link->dst->command_queue;
int64_t pts;
if ... | 26,519 |
FFmpeg | 1389b4c18d1042c196603ba66c25113bcee1738b | 0 | static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
{
int a0, a1, a2, a3, b0, b1, b2, b3;
#if HAVE_FAST_64BIT
#define ROW0_MASK (0xffffLL << 48 * HAVE_BIGENDIAN)
if (((((uint64_t *)row)[0] & ~ROW0_MASK) | ((uint64_t *)row)[1]) == 0) {
uint64_t temp;
if (DC_SHIFT - extr... | 26,520 |
FFmpeg | de6a1e32fd483db05d957268d5e45e2b1be9cab4 | 1 | static int io_write_data_type(void *opaque, uint8_t *buf, int size,
enum AVIODataMarkerType type, int64_t time)
{
char timebuf[30], content[5] = { 0 };
const char *str;
switch (type) {
case AVIO_DATA_MARKER_HEADER: str = "header"; break;
case AVIO_DATA_... | 26,523 |
FFmpeg | c7269e3a2697c189c907832b8a36341cbb40936c | 1 | static void release_buffer(AVCodecContext *avctx, AVFrame *pic)
{
int i;
CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->data[3];
CVPixelBufferUnlockBaseAddress(cv_buffer, 0);
CVPixelBufferRelease(cv_buffer);
for (i = 0; i < 4; i++)
pic->data[i] = NULL;
}
| 26,524 |
FFmpeg | 233f6f889ea310c2213f1f678b68e424791bf843 | 0 | AVOption *av_set_string(void *obj, const char *name, const char *val){
AVOption *o= find_opt(obj, name);
if(!o || !val || o->offset<=0)
return NULL;
if(o->type != FF_OPT_TYPE_STRING){
double d=0, tmp_d;
for(;;){
int i;
char buf[256], *tail;
... | 26,526 |
qemu | 6f321e93abb27b4e7ceb228b4204aa304e95daad | 1 | static void qed_aio_write_alloc(QEDAIOCB *acb, size_t len)
{
BDRVQEDState *s = acb_to_s(acb);
/* Freeze this request if another allocating write is in progress */
if (acb != QSIMPLEQ_FIRST(&s->allocating_write_reqs)) {
QSIMPLEQ_INSERT_TAIL(&s->allocating_write_reqs, acb, next);
}
if... | 26,528 |
qemu | 157e94e8a2f7d3e14060d833bd1519a83099eaa9 | 1 | static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
{
NumaOptions *object = NULL;
Error *err = NULL;
{
Visitor *v = opts_visitor_new(opts);
visit_type_NumaOptions(v, NULL, &object, &err);
visit_free(v);
}
if (err) {
goto error;
}
... | 26,529 |
qemu | 6f442fe83821a06c5408056c7879e83a74f2ff32 | 1 | static uint8_t send_read_command(void)
{
uint8_t drive = 0;
uint8_t head = 0;
uint8_t cyl = 0;
uint8_t sect_addr = 1;
uint8_t sect_size = 2;
uint8_t eot = 1;
uint8_t gap = 0x1b;
uint8_t gpl = 0xff;
uint8_t msr = 0;
uint8_t st0;
uint8_t ret = 0;
floppy_s... | 26,532 |
qemu | b074e6220542107afb9fad480a184775be591d2a | 1 | static void trigger_ascii_console_data(void *opaque, int n, int level)
{
sclp_service_interrupt(0);
}
| 26,533 |
qemu | 0ca4f94195cce77b624edc6d9abcf14a3bf01f06 | 1 | static uint64_t bonito_readl(void *opaque, hwaddr addr,
unsigned size)
{
PCIBonitoState *s = opaque;
uint32_t saddr;
saddr = (addr - BONITO_REGBASE) >> 2;
DPRINTF("bonito_readl "TARGET_FMT_plx"\n", addr);
switch (saddr) {
case BONITO_INTISR:
retu... | 26,534 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static int virtio_net_can_receive(void *opaque)
{
VirtIONet *n = opaque;
return do_virtio_net_can_receive(n, VIRTIO_NET_MAX_BUFSIZE);
}
| 26,536 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static void bt_hci_inquiry_result(struct bt_hci_s *hci,
struct bt_device_s *slave)
{
if (!slave->inquiry_scan || !hci->lm.responses_left)
return;
hci->lm.responses_left --;
hci->lm.responses ++;
switch (hci->lm.inquiry_mode) {
case 0x00:
bt_hci_inquiry_re... | 26,539 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t hpet_ram_readw(void *opaque, target_phys_addr_t addr)
{
printf("qemu: hpet_read w at %" PRIx64 "\n", addr);
return 0;
}
| 26,541 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | gen_intermediate_code_internal(MicroBlazeCPU *cpu, TranslationBlock *tb,
bool search_pc)
{
CPUState *cs = CPU(cpu);
CPUMBState *env = &cpu->env;
uint32_t pc_start;
int j, lj;
struct DisasContext ctx;
struct DisasContext *dc = &ctx;
uint32_t next_page_s... | 26,542 |
qemu | acfb23ad3dd8d0ab385a10e483776ba7dcf927ad | 0 | static void test_bh_delete_from_cb_many(void)
{
BHTestData data1 = { .n = 0, .max = 1 };
BHTestData data2 = { .n = 0, .max = 3 };
BHTestData data3 = { .n = 0, .max = 2 };
BHTestData data4 = { .n = 0, .max = 4 };
data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
data2.bh = aio_bh_new(ctx... | 26,544 |
qemu | 2e6fc7eb1a4af1b127df5f07b8bb28af891946fa | 0 | static int raw_has_zero_init(BlockDriverState *bs)
{
return bdrv_has_zero_init(bs->file->bs);
}
| 26,545 |
qemu | fd8f5e37557596e14a859d8edf3dc24523bd4400 | 0 | void bios_linker_loader_add_pointer(GArray *linker,
const char *dest_file,
const char *src_file,
GArray *table, void *pointer,
uint8_t pointer_size)
{
BiosLinkerLoade... | 26,546 |
qemu | b1424e0381a7f1c9969079eca4458d5f20bf1859 | 0 | static void vga_draw_graphic(VGACommonState *s, int full_update)
{
int y1, y, update, linesize, y_start, double_scan, mask, depth;
int width, height, shift_control, line_offset, bwidth, bits;
ram_addr_t page0, page1, page_min, page_max;
int disp_width, multi_scan, multi_run;
uint8_t *d;
u... | 26,547 |
FFmpeg | 3438d82d4b3bd987304975961e2a42e82767107d | 0 | static int ffm_write_header(AVFormatContext *s)
{
FFMContext *ffm = s->priv_data;
AVStream *st;
ByteIOContext *pb = s->pb;
AVCodecContext *codec;
int bit_rate, i;
ffm->packet_size = FFM_PACKET_SIZE;
/* header */
put_le32(pb, MKTAG('F', 'F', 'M', '1'));
put_be32(pb, ffm-... | 26,548 |
qemu | 190563f9a90c9df8ad32fc7f3e4b166deda949a6 | 0 | static int usb_net_handle_datain(USBNetState *s, USBPacket *p)
{
int ret = USB_RET_NAK;
if (s->in_ptr > s->in_len) {
s->in_ptr = s->in_len = 0;
ret = USB_RET_NAK;
return ret;
}
if (!s->in_len) {
ret = USB_RET_NAK;
return ret;
}
ret = s->in_le... | 26,549 |
qemu | 7d3467d903c0fa663fbe3f1002e7c624a210b634 | 0 | static void usb_msd_realize_storage(USBDevice *dev, Error **errp)
{
MSDState *s = USB_STORAGE_DEV(dev);
BlockBackend *blk = s->conf.blk;
SCSIDevice *scsi_dev;
Error *err = NULL;
if (!blk) {
error_setg(errp, "drive property not set");
return;
}
bdrv_add_key(blk_b... | 26,550 |
qemu | 6214e73cc5b75a4f8d89a70d71727edfa47a81b3 | 0 | static int usb_xhci_initfn(struct PCIDevice *dev)
{
int i, ret;
XHCIState *xhci = DO_UPCAST(XHCIState, pci_dev, dev);
xhci->pci_dev.config[PCI_CLASS_PROG] = 0x30; /* xHCI */
xhci->pci_dev.config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin 1 */
xhci->pci_dev.config[PCI_CACHE_LINE_SIZE] =... | 26,551 |
qemu | ad523590f62cf5d44e97388de370d27b95b25aff | 0 | void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n,
bool is_write)
{
hwaddr addr, granularity;
IOMMUTLBEntry iotlb;
IOMMUAccessFlags flag = is_write ? IOMMU_WO : IOMMU_RO;
/* If the IOMMU has its own replay callback, override */
if (mr->iommu_... | 26,553 |
qemu | 56a6f02b8ce1fe41a2a9077593e46eca7d98267d | 0 | static void qmp_output_end_list(Visitor *v)
{
QmpOutputVisitor *qov = to_qov(v);
qmp_output_pop(qov);
}
| 26,554 |
FFmpeg | 508a24f8dc63e74bd9917e6f0c4cdbb744741ef0 | 0 | static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){
if( avctx->thread_count > 1)
return -1;
if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
return -1;
if( !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD) ){
av_dlog(avctx, "mpeg12.c: XvMC decoder will work better i... | 26,555 |
FFmpeg | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 | 0 | static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
{
AvsFormat *avs = s->priv_data;
int sub_type = 0, size = 0;
AvsBlockType type = AVS_NONE;
int palette_size = 0;
uint8_t palette[4 + 3 * 256];
int ret;
if (avs->remaining_audio_size > 0)
if (avs_read_audio_pac... | 26,556 |
qemu | 2ba82852894c762299b7d05e9a2be184116b80f0 | 1 | static void *file_ram_alloc(RAMBlock *block,
ram_addr_t memory,
const char *path)
{
char *filename;
char *sanitized_name;
char *c;
void *area;
int fd;
unsigned long hpagesize;
hpagesize = gethugepagesize(path);
if (!hpa... | 26,557 |
qemu | 2d896b454a0e19ec4c1ddbb0e0b65b7e54fcedf3 | 1 | static void boston_register_types(void)
{
type_register_static(&boston_device);
}
| 26,558 |
qemu | 0c9390d978cbf61e8f16c9f580fa96b305c43568 | 1 | static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition,
gpointer opaque)
{
QIOChannelSocket *cioc;
if (!nbd_server) {
return FALSE;
}
cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc),
NULL);
if (... | 26,560 |
FFmpeg | 79ff462e73e73591573bcd01e8ee6614b7ac1c69 | 1 | static int bfi_decode_frame(AVCodecContext * avctx, void *data,
int *data_size, const uint8_t * buf,
int buf_size)
{
BFIContext *bfi = avctx->priv_data;
uint8_t *dst = bfi->dst;
uint8_t *src, *dst_offset, colour1, colour2;
uint8_t *frame_end... | 26,561 |
qemu | 6573d9c63885aaf533366ab5c68318d1cf1a0fcc | 0 | bool block_job_user_paused(BlockJob *job)
{
return job ? job->user_paused : 0;
}
| 26,562 |
qemu | 0dfe952dc5c2921488a1172407857d5bb81d17a4 | 0 | static void booke_decr_cb(void *opaque)
{
PowerPCCPU *cpu = opaque;
CPUPPCState *env = &cpu->env;
env->spr[SPR_BOOKE_TSR] |= TSR_DIS;
booke_update_irq(cpu);
if (env->spr[SPR_BOOKE_TCR] & TCR_ARE) {
/* Auto Reload */
cpu_ppc_store_decr(env, env->spr[SPR_BOOKE_DECAR]);
... | 26,563 |
qemu | 9f8863ebd7f584762a906881a62a04ac05ce4898 | 0 | static char *read_splashfile(char *filename, size_t *file_sizep,
int *file_typep)
{
GError *err = NULL;
gboolean res;
gchar *content;
int file_type = -1;
unsigned int filehead = 0;
int bmp_bpp;
res = g_file_get_contents(filename, &content, file_sizep, ... | 26,564 |
qemu | d3b12f5dec4b27ebab58fb5797cb67bacced773b | 0 | static void qemu_event_read(void *opaque)
{
int fd = (intptr_t)opaque;
ssize_t len;
char buffer[512];
/* Drain the notify pipe. For eventfd, only 8 bytes will be read. */
do {
len = read(fd, buffer, sizeof(buffer));
} while ((len == -1 && errno == EINTR) || len == sizeof(buff... | 26,565 |
qemu | 1ea879e5580f63414693655fcf0328559cdce138 | 0 | static int coreaudio_init_out (HWVoiceOut *hw, audsettings_t *as)
{
OSStatus status;
coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;
UInt32 propertySize;
int err;
const char *typ = "playback";
AudioValueRange frameRange;
/* create mutex */
err = pthread_mutex_init(&core->m... | 26,567 |
qemu | 3468b59e18b179bc63c7ce934de912dfa9596122 | 0 | void tcg_region_init(void)
{
void *buf = tcg_init_ctx.code_gen_buffer;
void *aligned;
size_t size = tcg_init_ctx.code_gen_buffer_size;
size_t page_size = qemu_real_host_page_size;
size_t region_size;
size_t n_regions;
size_t i;
/* We do not yet support multiple TCG contexts, s... | 26,570 |
qemu | 1cf0d2b8352a2df35919030b84dbfc713ee9b9be | 0 | static int vt82c686b_ac97_initfn(PCIDevice *dev)
{
VT686AC97State *s = DO_UPCAST(VT686AC97State, dev, dev);
uint8_t *pci_conf = s->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_AC97);
pci_config_set_class(pci_conf, PCI... | 26,571 |
qemu | 10c4c98ab7dc18169b37b76f6ea5e60ebe65222b | 0 | void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent)
{
SysBusDevice *s = sysbus_from_qdev(dev);
int i;
for (i = 0; i < s->num_mmio; i++) {
monitor_printf(mon, "%*smmio " TARGET_FMT_plx "/" TARGET_FMT_plx "\n",
indent, "", s->mmio[i].addr, s->mmio[i].size);... | 26,572 |
qemu | 18e80c55bb6ec17c05ec0ba717ec83933c2bfc07 | 0 | static void handle_arg_reserved_va(const char *arg)
{
char *p;
int shift = 0;
reserved_va = strtoul(arg, &p, 0);
switch (*p) {
case 'k':
case 'K':
shift = 10;
break;
case 'M':
shift = 20;
break;
case 'G':
shift = 30;
break;
... | 26,574 |
qemu | ffbb1705a33df8e2fb12b24d96663d63b22eaf8b | 0 | void spapr_events_init(sPAPRMachineState *spapr)
{
QTAILQ_INIT(&spapr->pending_events);
spapr->check_exception_irq = xics_spapr_alloc(spapr->xics, 0, false,
&error_fatal);
spapr->epow_notifier.notify = spapr_powerdown_req;
qemu_register_powerdown_notifie... | 26,575 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | static void bdrv_co_maybe_schedule_bh(BlockAIOCBCoroutine *acb)
{
acb->need_bh = false;
if (acb->req.error != -EINPROGRESS) {
BlockDriverState *bs = acb->common.bs;
acb->bh = aio_bh_new(bdrv_get_aio_context(bs), bdrv_co_em_bh, acb);
qemu_bh_schedule(acb->bh);
}
}
| 26,577 |
qemu | 6ed92b14f610c78aea52b087d6bdc59a3f2de72a | 0 | static void xlnx_zynqmp_init(Object *obj)
{
XlnxZynqMPState *s = XLNX_ZYNQMP(obj);
int i;
for (i = 0; i < XLNX_ZYNQMP_NUM_APU_CPUS; i++) {
object_initialize(&s->apu_cpu[i], sizeof(s->apu_cpu[i]),
"cortex-a53-" TYPE_ARM_CPU);
object_property_add_child(obj, "... | 26,578 |
FFmpeg | 50ce510ac4e3ed093c051738242a9a75aeeb36ce | 0 | static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)
{
SliceThreadContext *c = avctx->internal->thread_ctx;
int dummy_ret;
if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1)
return avcodec_default_exec... | 26,579 |
qemu | 5b4dd0f55ed3027557ed9a6fd89d5aa379122feb | 0 | static int xen_pt_config_reg_init(XenPCIPassthroughState *s,
XenPTRegGroup *reg_grp, XenPTRegInfo *reg)
{
XenPTReg *reg_entry;
uint32_t data = 0;
int rc = 0;
reg_entry = g_new0(XenPTReg, 1);
reg_entry->reg = reg;
if (reg->init) {
uint32_t ho... | 26,580 |
FFmpeg | e8a3498f2452ba2be605b1ffb5974143095aacf1 | 1 | static void chs_assemble_msbs_lsbs(DCAXllDecoder *s, DCAXllChSet *c, int band)
{
DCAXllBand *b = &c->bands[band];
int n, ch, nsamples = s->nframesamples;
for (ch = 0; ch < c->nchannels; ch++) {
int shift = chs_get_lsb_width(s, c, band, ch);
if (shift) {
int32_t *msb = b-... | 26,581 |
qemu | b544c1aba8681c2fe5d6715fbd37cf6caf1bc7bb | 1 | static void coroutine_fn send_pending_req(BDRVSheepdogState *s, uint64_t oid)
{
AIOReq *aio_req;
SheepdogAIOCB *acb;
while ((aio_req = find_pending_req(s, oid)) != NULL) {
acb = aio_req->aiocb;
/* move aio_req from pending list to inflight one */
QLIST_REMOVE(aio_req, aio_si... | 26,582 |
FFmpeg | 5a3a906ba29b53fa34d3047af78d9f8fd7678256 | 1 | static av_cold int vqa_decode_init(AVCodecContext *avctx)
{
VqaContext *s = avctx->priv_data;
unsigned char *vqa_header;
int i, j, codebook_index;
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
/* make sure the extradata made it */
if (s->avctx->extradata_size != VQA_HEADER_SIZ... | 26,583 |
FFmpeg | 14e4e26559697cfdea584767be4e68474a0a9c7f | 1 | static int t27(InterplayACMContext *s, unsigned ind, unsigned col)
{
GetBitContext *gb = &s->gb;
unsigned i, b;
int n1, n2, n3;
for (i = 0; i < s->rows; i++) {
/* b = (x1) + (x2 * 5) + (x3 * 25) */
b = get_bits(gb, 7);
n1 = (mul_3x5[b] & 0x0F) - 2;
n2 = ... | 26,585 |
FFmpeg | ddd7559ad97d3cde401ce096262af6375685ea22 | 1 | static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){
MpegEncContext * const s = &h->s;
static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
int level[16];
int... | 26,586 |
FFmpeg | d81be0a60a6dea2bc48ec29f9466eee63984ed34 | 1 | static AVFrame *hwmap_get_buffer(AVFilterLink *inlink, int w, int h)
{
AVFilterContext *avctx = inlink->dst;
AVFilterLink *outlink = avctx->outputs[0];
HWMapContext *ctx = avctx->priv;
if (ctx->map_backwards) {
AVFrame *src, *dst;
int err;
src = ff_get_video_buf... | 26,588 |
FFmpeg | 29b0d94b43ac960cb442049a5d737a3386ff0337 | 1 | static int decode_wdlt(uint8_t *frame, int width, int height,
const uint8_t *src, const uint8_t *src_end)
{
const uint8_t *frame_end = frame + width * height;
uint8_t *line_ptr;
int count, i, v, lines, segments;
lines = bytestream_get_le16(&src);
if (lines > height ... | 26,589 |
FFmpeg | 6526976f0cbb3fa152797b3a15bd634ad14cabe3 | 0 | av_cold void ff_vp8dsp_init_x86(VP8DSPContext* c)
{
mm_flags = mm_support();
#if HAVE_YASM
if (mm_flags & FF_MM_MMX) {
c->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmx;
c->vp8_idct_add = ff_vp8_idct_add_mmx;
c->put_vp8_epel_pixels_tab[0][0][0] ... | 26,590 |
FFmpeg | e1bd40fe6beb74a942b7b0cff2d077750a7e733e | 0 | PIX_SAD(mmxext)
#endif /* HAVE_INLINE_ASM */
av_cold void ff_dsputil_init_pix_mmx(DSPContext *c, AVCodecContext *avctx)
{
#if HAVE_INLINE_ASM
int cpu_flags = av_get_cpu_flags();
if (INLINE_MMX(cpu_flags)) {
c->pix_abs[0][0] = sad16_mmx;
c->pix_abs[0][1] = sad16_x2_mmx;
c->... | 26,591 |
qemu | f0267ef7115656119bf00ed77857789adc036bda | 0 | void cpu_loop(CPUARMState *env)
{
CPUState *cs = CPU(arm_env_get_cpu(env));
int trapnr;
unsigned int n, insn;
target_siginfo_t info;
uint32_t addr;
for(;;) {
cpu_exec_start(cs);
trapnr = cpu_arm_exec(cs);
cpu_exec_end(cs);
switch(trapnr) {
ca... | 26,592 |
qemu | 65e7545ea3c65a6468fb59418a6dbe66ef71d6d1 | 0 | static void sunkbd_event(void *opaque, int ch)
{
ChannelState *s = opaque;
int release = ch & 0x80;
trace_escc_sunkbd_event_in(ch);
switch (ch) {
case 58: // Caps lock press
s->caps_lock_mode ^= 1;
if (s->caps_lock_mode == 2)
return; // Drop second press
... | 26,593 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static void omap_pwl_update(struct omap_pwl_s *s)
{
int output = (s->clk && s->enable) ? s->level : 0;
if (output != s->output) {
s->output = output;
printf("%s: Backlight now at %i/256\n", __FUNCTION__, output);
}
}
| 26,594 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void free_note_info(struct elf_note_info *info)
{
struct elf_thread_status *ets;
while (!TAILQ_EMPTY(&info->thread_list)) {
ets = TAILQ_FIRST(&info->thread_list);
TAILQ_REMOVE(&info->thread_list, ets, ets_link);
qemu_free(ets);
}
qemu_free(info->prstatus);
... | 26,596 |
qemu | 17e2377abf16c3951d7d34521ceade4d7dc31d01 | 0 | void *get_mmap_addr(unsigned long size)
{
return NULL;
}
| 26,597 |
qemu | cc2212c2f851291929becc3f4fd153d05ca4c54a | 0 | uint32_t HELPER(neon_narrow_sat_s32)(CPUState *env, uint64_t x)
{
if ((int64_t)x != (int32_t)x) {
SET_QC();
return (x >> 63) ^ 0x7fffffff;
}
return x;
}
| 26,598 |
qemu | 29396ed9acfaee9936377ddece4b05452b417861 | 0 | static void amdvi_realize(DeviceState *dev, Error **err)
{
int ret = 0;
AMDVIState *s = AMD_IOMMU_DEVICE(dev);
X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev);
MachineState *ms = MACHINE(qdev_get_machine());
MachineClass *mc = MACHINE_GET_CLASS(ms);
PCMachineState *pcms =
PC_MAC... | 26,601 |
FFmpeg | ca16618b01abfde44b4eaf92dc89b01aa1b4a91e | 0 | static int xan_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
XanContext *s = avctx->priv_data;
AVPaletteControl *palette_control = avctx->palctrl;
int keyframe = 0;
if (palette_control->palet... | 26,602 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | void helper_rdmsr(void)
{
uint64_t val;
helper_svm_check_intercept_param(SVM_EXIT_MSR, 0);
switch((uint32_t)ECX) {
case MSR_IA32_SYSENTER_CS:
val = env->sysenter_cs;
break;
case MSR_IA32_SYSENTER_ESP:
val = env->sysenter_esp;
break;
case MSR_IA32_SY... | 26,603 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
{
struct capture_callback *cb;
for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
if (cb->opaque == cb_opaque) {
cb->ops.destroy (cb_opaque);
LIST_REMOVE (cb, entries);
qemu_free (cb);... | 26,604 |
qemu | ef76dc59fa5203d146a2acf85a0ad5a5971a4824 | 0 | START_TEST(unterminated_dict)
{
QObject *obj = qobject_from_json("{'abc':32");
fail_unless(obj == NULL);
}
| 26,605 |
qemu | e57ca75ce3b2bd33102573a8c0555d62e1bcfceb | 0 | static void spapr_cpu_reset(void *opaque)
{
sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
PowerPCCPU *cpu = opaque;
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
cpu_reset(cs);
/* All CPUs start halted. CPU0 is unhalted from the machine level
* reset co... | 26,607 |
qemu | efb9ee024845982a210bfe48a73298846adfe9da | 0 | static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)
{
int is_read = (type == SCSI_REQ_STATUS_RETRY_READ);
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
BlockErrorAction action = bdrv_get_on_error(s->bs, is_read);
if (action == BLOCK_ERR_IGNORE) {
bdrv_mo... | 26,608 |
qemu | 8297be80f7cf71e09617669a8bd8b2836dcfd4c3 | 0 | void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque)
{
unsigned long size;
struct rlimit rlimit_as;
mapcache = g_malloc0(sizeof (MapCache));
mapcache->phys_offset_to_gaddr = f;
mapcache->opaque = opaque;
qemu_mutex_init(&mapcache->lock);
QTAILQ_INIT(&mapcache->locked... | 26,609 |
FFmpeg | 195784ec95266c69c111f1e977fd4cf4815c6d8d | 0 | static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
{
LibOpenJPEGContext *ctx = avctx->priv_data;
int err = 0;
opj_set_default_encoder_parameters(&ctx->enc_params);
#if HAVE_OPENJPEG_2_1_OPENJPEG_H
switch (ctx->cinema_mode) {
case OPJ_CINEMA2K_24:
ctx->enc_params.rs... | 26,610 |
FFmpeg | ef4c71e8f83a46fb31a11f0a066efb90821c579f | 0 | static void init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char *effect_type, int width)
{
int z;
const char *effect;
effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen";
av_log(ctx, AV_LOG_VERBOSE, "effect:%s type:%s msize_x:%d msize_y:%d amount:%0.2f\n",
... | 26,611 |
FFmpeg | 5df703aa1b03814e9cd216ab703501481166b3bb | 0 | static inline void FUNC(idctRowCondDC_extrashift)(int16_t *row, int extra_shift)
#else
static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
#endif
{
int a0, a1, a2, a3, b0, b1, b2, b3;
#if HAVE_FAST_64BIT
#define ROW0_MASK (0xffffLL << 48 * HAVE_BIGENDIAN)
if (((((uint64_t *)row)[0] &... | 26,612 |
FFmpeg | 9888ffb1ce5e0a17f711b01933d504c72ea29d3b | 0 | static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_data;
avio_r8(pb); /* version */
avio_r... | 26,613 |
FFmpeg | 3faa303a47e0c3b59a53988e0f76018930c6cb1a | 0 | static inline void decode_subblock(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)
{
int coeffs[4];
coeffs[0] = modulo_three_table[code][0];
coeffs[1] = modulo_three_table[code][1];
coeffs[2] = modulo_three_table[code][2];
coeffs[3] = modulo_three_table[code]... | 26,615 |
qemu | 5e5a94b60518002e8ecc7afa78a9e7565b23e38f | 1 | static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs,
BdrvTrackedRequest *req, int64_t offset, unsigned int bytes,
QEMUIOVector *qiov, int flags)
{
BlockDriver *drv = bs->drv;
bool waited;
int ret;
int64_t sector_num = offset >> BDRV_SECTOR_BITS;
unsigned int nb_sector... | 26,617 |
FFmpeg | fdbc544d29176ba69d67dd879df4696f0a19052e | 1 | static int process_metadata(AVFormatContext *s, uint8_t *name, uint16_t name_len,
uint16_t val_len, uint16_t type, AVDictionary **met)
{
int ret;
ff_asf_guid guid;
if (val_len) {
switch (type) {
case ASF_UNICODE:
asf_read_value(s, name, name_... | 26,618 |
qemu | a79b5f8b80890b402fdb0733b0a073695a7875b5 | 1 | static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode,
const char *name,
V9fsSynthNodeAttr *attr, int inode)
{
V9fsSynthNode *node;
/* Add directory type and remove write bits */
mode = ((mode & 0777) |... | 26,621 |
FFmpeg | 86736f59d6a527d8bc807d09b93f971c0fe0bb07 | 0 | static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
{
long i;
for (i = 0; i <= w - sizeof(long); i += sizeof(long)) {
long a = *(long *)(src1 + i);
long b = *(long *)(src2 + i);
*(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
}
... | 26,622 |
qemu | 7f64f8e2c3c5a02636c2a6b8d6e6c5f7a62b89f7 | 1 | static int scsi_disk_emulate_command(SCSIDiskReq *r)
{
SCSIRequest *req = &r->req;
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
uint64_t nb_sectors;
uint8_t *outbuf;
int buflen = 0;
if (!r->iov.iov_base) {
/*
* FIXME: we shouldn't return anything bigge... | 26,623 |
qemu | 3ae59580a0db469c1de72d5c58266b08fb096056 | 1 | static void bdrv_delete(BlockDriverState *bs)
{
assert(!bs->dev);
assert(!bs->job);
assert(bdrv_op_blocker_is_empty(bs));
assert(!bs->refcnt);
assert(QLIST_EMPTY(&bs->dirty_bitmaps));
bdrv_close(bs);
/* remove from list, if necessary */
bdrv_make_anon(bs);
g_free(bs)... | 26,624 |
qemu | 302a0d3ed721e4c30c6a2a37f64c60b50ffd33b9 | 1 | static void v9fs_write(void *opaque)
{
int cnt;
ssize_t err;
int32_t fid;
int64_t off;
int32_t count;
int32_t len = 0;
int32_t total = 0;
size_t offset = 7;
V9fsFidState *fidp;
struct iovec iov[128]; /* FIXME: bad, bad, bad */
struct iovec *sg = iov;
V9fsPDU ... | 26,625 |
FFmpeg | fed50c4304eecb352e29ce789cdb96ea84d6162f | 1 | void av_set_cpu_flags_mask(int mask)
{
cpu_flags = get_cpu_flags() & mask;
}
| 26,626 |
FFmpeg | 21d8c6612fcec630785af5c0ae087d0393bb2a8e | 1 | static int decode_header_trees(SmackVContext *smk) {
GetBitContext gb;
int mmap_size, mclr_size, full_size, type_size, ret;
mmap_size = AV_RL32(smk->avctx->extradata);
mclr_size = AV_RL32(smk->avctx->extradata + 4);
full_size = AV_RL32(smk->avctx->extradata + 8);
type_size = AV_RL32(smk-... | 26,627 |
qemu | 164a101f28a53cd3db60ed874e7c3630e7988ed8 | 1 | void aio_set_fd_handler(AioContext *ctx,
int fd,
IOHandler *io_read,
IOHandler *io_write,
AioFlushHandler *io_flush,
void *opaque)
{
AioHandler *node;
node = find_aio_handler(ctx, fd... | 26,628 |
FFmpeg | 6dfffe92004dfd8c79d18791f28a2b1c7e387845 | 0 | av_cold static int auto_matrix(SwrContext *s)
{
int i, j, out_i;
double matrix[64][64]={{0}};
int64_t unaccounted, in_ch_layout, out_ch_layout;
double maxcoef=0;
char buf[128];
const int matrix_encoding = s->matrix_encoding;
float maxval;
in_ch_layout = clean_layout(s, s->in_c... | 26,630 |
FFmpeg | 90540c2d5ace46a1e9789c75fde0b1f7dbb12a9b | 1 | static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size)
{
const uint8_t *s = src;
const uint8_t *end;
const uint8_t *mm_end;
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
__asm__ volatile(PREFETCH" %0"::"m"(*src):"memory");
__asm__ volatile(
... | 26,631 |
qemu | e9a07334fb6ee08ddd61787c102d36e7e781efef | 1 | static void g364fb_update_display(void *opaque)
{
G364State *s = opaque;
if (s->width == 0 || s->height == 0)
return;
if (s->width != ds_get_width(s->ds) || s->height != ds_get_height(s->ds)) {
qemu_console_resize(s->ds, s->width, s->height);
}
if (s->ctla & CTLA_FORCE_BLANK) {
... | 26,632 |
FFmpeg | 426a322aa2bfd8ec28e467743c79dad81c63c108 | 1 | static int decode_pic(AVSContext *h)
{
int ret;
int skip_count = -1;
enum cavs_mb mb_type;
if (!h->top_qp) {
av_log(h->avctx, AV_LOG_ERROR, "No sequence header decoded yet\n");
return AVERROR_INVALIDDATA;
}
av_frame_unref(h->cur.f);
skip_bits(&h->gb, 16);//... | 26,633 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void bmds_set_aio_inflight(BlkMigDevState *bmds, int64_t sector_num,
int nb_sectors, int set)
{
int64_t start, end;
unsigned long val, idx, bit;
start = sector_num / BDRV_SECTORS_PER_DIRTY_CHUNK;
end = (sector_num + nb_sectors - 1) / BDRV_SECTORS_PER_DIRTY_CHU... | 26,634 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.